Skip to content

fix(voice): send language and prompt in streamed STT - #4533

Open
sylvesterkaczmarek wants to merge 8 commits into
openai:mainfrom
sylvesterkaczmarek:fix/stt-stream-language-prompt
Open

fix(voice): send language and prompt in streamed STT#4533
sylvesterkaczmarek wants to merge 8 commits into
openai:mainfrom
sylvesterkaczmarek:fix/stt-stream-language-prompt

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Honor STTModelSettings.language and STTModelSettings.prompt in streamed OpenAI transcription sessions.

The non-streaming STT path already forwards both settings to audio.transcriptions.create(), but the streamed path previously sent only the transcription model. Callers could therefore configure language or prompt and still have those values silently omitted from the Realtime transcription session.

Fix

  • include prompt when explicitly configured
  • use plural languages: [value] for gpt-transcribe and gpt-live-transcribe
  • retain singular language for existing streamed transcription models such as gpt-4o-transcribe
  • omit language/prompt keys when unset, preserving the existing default session payload
  • leave temperature unchanged because it is not part of the current Realtime transcription-session configuration

Test plan

Focused coverage verifies that:

  • gpt-4o-transcribe receives singular language and configured prompt
  • gpt-transcribe receives plural languages: [value]
  • gpt-live-transcribe receives plural languages: [value]
  • unset values are omitted and the transcription payload remains model-only

Risk

Low. Existing callers that do not set language or prompt produce the same payload as before. The behavior changes only for settings that callers explicitly requested but that the streamed path previously ignored.

Issue number

None. Found while auditing parity between static and streamed STT settings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5121a8b839

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/voice/models/openai_stt.py Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Note

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

Note

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

@seratch seratch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution. Forwarding language and prompt in streamed STT is the correct direction, but the current model split is incomplete. Both gpt-transcribe and gpt-live-transcribe use the plural languages field; existing transcription models continue to use singular language.

Please apply the plural mapping to both current models and add regression coverage for gpt-transcribe, while retaining the existing singular-field and unset-value tests.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f485f1553

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

assert self._websocket is not None, "Websocket not initialized"
transcription_config: dict[str, Any] = {"model": self._model}
if self._settings.language is not None:
if self._model in {"gpt-transcribe", "gpt-live-transcribe"}:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep gpt-transcribe on the singular language field

When callers select gpt-transcribe and set STTModelSettings.language, this condition now serializes the value as languages, but docs/realtime/guide.md:115 reserves plural languages for gpt-live-transcribe, while line 140 identifies gpt-transcribe's plural field as completion output rather than expected-language input. The session update therefore does not send the requested singular input language and may be rejected; keep gpt-transcribe on language and reserve this list conversion for gpt-live-transcribe. Fresh evidence since the prior thread is the follow-up widening of this condition to include gpt-transcribe.

AGENTS.md reference: AGENTS.md:L167-L167

Useful? React with 👍 / 👎.

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Addressed. Both gpt-transcribe and gpt-live-transcribe now map STTModelSettings.language to plural languages: [value], while existing transcription models retain singular language. Added focused gpt-transcribe regression coverage while retaining the existing singular-field and unset-value tests. Ready for re-review.

@seratch

seratch commented Aug 21, 2026

Copy link
Copy Markdown
Member

@sylvesterkaczmarek Can you complete these open PRs before sending further PRs? Thanks for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants