Skip to content

feat(bot): add OpenAI transcription provider - #10

Open
andrewyager wants to merge 1 commit into
antifield:mainfrom
andrewyager:openai-transcription
Open

andrewyager wants to merge 1 commit into
antifield:mainfrom
andrewyager:openai-transcription

Conversation

@andrewyager

Copy link
Copy Markdown

Adds an optional OpenAI speech-to-text provider (gpt-4o-transcribe) behind the existing TranscriptionProvider protocol.

  • Selected when OPENAI_API_KEY is set; takes precedence over ElevenLabs, with Google Web Speech still the keyless fallback
  • Mirrors the ElevenLabs provider shape: sync SDK client in asyncio.to_thread, wrapped in retry_with_backoff (SDK's built-in retries disabled so they don't stack)
  • Retries the same status codes as ElevenLabs plus connection errors, never auth/bad-input failures
  • .env.example and README updated; tests cover provider selection, transcript stripping, empty-transcript handling, and settings loading

All checks green: pytest (37 passed), ruff check/format, basedpyright (0 errors).

🤖 Generated with Claude Code

Adds an OpenAIProvider using gpt-4o-transcribe via the official SDK,
selected when OPENAI_API_KEY is set. It takes precedence over
ElevenLabs; Google Web Speech remains the keyless fallback. Retries
reuse the shared retry_with_backoff with the SDK's own retries
disabled to avoid doubling up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant