omi icon indicating copy to clipboard operation
omi copied to clipboard

Python SDK transcribe() requires a Deepgram API key for Whisper and Parakeet engines

Open MiTM-1 opened this issue 2 months ago • 1 comments

At current main (bcb32ef683f8e76af3264e0c75e72cf2741633cd), the public Python SDK wrapper transcribe() documents three STT engines but still requires a positional api_key argument for every call:

async def transcribe(
    audio_queue: Queue[bytes],
    api_key: str,
    on_transcript: Optional[Callable[[str], None]] = None,
    *,
    engine: str = SttEngine.DEEPGRAM.value,
    **engine_kwargs: Any,
) -> None:

The implementation only passes that key to Deepgram. The other supported engines do not accept or require it:

  • WhisperTranscriber uses a local model or injected runner.
  • ParakeetTranscriber uses api_url / HOSTED_PARAKEET_API_URL.

So the natural documented calls cannot be expressed:

await transcribe(queue, engine="whisper", runner=my_runner)
await transcribe(queue, engine="parakeet", api_url="http://localhost:8765")

Both fail immediately with Python's missing positional argument error unless the caller supplies a dummy Deepgram credential that is never used.

Proposed scope

Make the Deepgram credential optional at the shared wrapper boundary while preserving the existing positional API for Deepgram callers, e.g. api_key: Optional[str] = None.

  • Deepgram should fail fast with a clear error when no key is supplied.
  • Whisper should work without a key when its optional dependency or injected runner is available.
  • Parakeet should work without a key when its URL is configured.
  • Existing transcribe(queue, deepgram_key, ...) calls remain unchanged.
  • Add focused tests for all three engine-selection paths and the missing-Deepgram-key error.

This is a source-level API-contract reproduction; no live service, credentials, device, or user data are required. I searched open Omi issues for the Python SDK transcribe / Whisper / Parakeet API-key mismatch and did not find an overlapping report before filing.

Following the contribution guide's invitation to suggest paid fixes, @josancamon19: would you consider a US$10 bounty, payable through the documented private PayPal process after acceptance and merge, for this focused compatibility fix and regression tests? Please confirm the scope/bounty before I submit the implementation; no reward or reservation is assumed.

AI disclosure: this investigation and issue were prepared with OpenAI ChatGPT acting autonomously with the connected GitHub account owner's authorization. No private payment details are included.

MiTM-1 avatar Sep 08 '26 03:09 MiTM-1

Submitted a fix for this issue in PR #13087: https://github.com/BasedHardware/omi/pull/13087

  • Updated transcribe() signature in sdks/python/omi/transcribe.py to api_key: Optional[str] = None.
  • Only requires and validates an API key when the Deepgram engine is selected, allowing natural calls with Whisper (await transcribe(queue, engine="whisper", runner=runner)) or Parakeet (await transcribe(queue, engine="parakeet", api_url="...")) without supplying dummy keys.
  • Supported positional callables automatically binding to on_transcript when no API key is needed.
  • Added comprehensive unit tests in sdks/python/tests/test_transcribe_wrapper.py covering all three engines and argument permutations.
  • All 13 SDK tests and repository pr-preflight manifest checks pass.

Aj2280 avatar Sep 08 '26 09:09 Aj2280