Skip to content

feat: Add Cohere Transcribe API support (recognize_cohere_api)#889

Merged
ftnext merged 3 commits intoUberi:masterfrom
ftnext:feature/cohere-transcribe-api
Mar 29, 2026
Merged

feat: Add Cohere Transcribe API support (recognize_cohere_api)#889
ftnext merged 3 commits intoUberi:masterfrom
ftnext:feature/cohere-transcribe-api

Conversation

@ftnext
Copy link
Copy Markdown
Collaborator

@ftnext ftnext commented Mar 29, 2026

Implement speech_recognition.recognizers.cohere_api using cohere.ClientV2 and audio.transcriptions.create, with optional extra cohere-api (PyPI cohere>=5.21.0).
Wire Recognizer.recognize_cohere_api, extend CI extras for resolver checks with openai/groq, add tests and document CO_API_KEY in README and library reference.

Closes: #888
Made-with: Cursor


Usage
with CO_API_KEY (Trial keys work)

>>> import speech_recognition as sr
>>> r = sr.Recognizer()
>>> with sr.AudioFile("path/to/audio.wav") as source:
...     audio_data = r.listen(source)
>>> r.recognize_cohere_api(audio_data, language="en")
'transcribed text'

Implement speech_recognition.recognizers.cohere using cohere.ClientV2 and
audio.transcriptions.create, with optional extra cohere-api (PyPI cohere>=5.21.0).
Wire Recognizer.recognize_cohere, extend CI extras for resolver checks with
openai/groq, add tests and document CO_API_KEY in README and library reference.

Refs: Uberi#888
Made-with: Cursor
@ftnext ftnext changed the title Add Cohere Transcribe API support (recognize_cohere) feat: Add Cohere Transcribe API support (recognize_cohere_api) Mar 29, 2026
@ftnext ftnext requested a review from Copilot March 29, 2026 03:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for Cohere’s Transcribe API as a new SpeechRecognition recognizer, including packaging/CI wiring and documentation so users can enable it via an optional extra.

Changes:

  • Introduce speech_recognition.recognizers.cohere_api implementing recognize_cohere_api() via cohere.ClientV2().audio.transcriptions.create(...).
  • Wire Recognizer.recognize_cohere_api, add cohere-api optional extra, and extend CI to install it.
  • Add unit tests plus documentation updates (README + library reference) describing usage and CO_API_KEY.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
speech_recognition/recognizers/cohere_api.py New Cohere Transcribe recognizer implementation using Cohere’s Python SDK.
speech_recognition/__init__.py Wires the new recognizer onto Recognizer as recognize_cohere_api.
pyproject.toml Adds cohere-api optional extra (cohere>=5.21.0).
.github/workflows/unittests.yml Installs cohere-api extra in CI test matrix.
tests/recognizers/test_cohere_api.py Adds tests validating the Cohere client call and parameters.
README.rst Documents Cohere Transcribe support and installation/env var expectations.
reference/library-reference.rst Adds API reference entry for recognize_cohere_api.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ftnext added 2 commits March 29, 2026 13:34
Align cohere_api with other recognizer modules (recognize + Recognizer.recognize_* wiring). Public API remains recognize_cohere_api.

Made-with: Cursor
@ftnext ftnext merged commit 920526d into Uberi:master Mar 29, 2026
9 checks passed
@ftnext ftnext deleted the feature/cohere-transcribe-api branch March 29, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Cohere Transcribe (First, API)

2 participants