Repository navigation
fix(openai): don't persist the per-call language passed to recognize() - #7820
Closed
Atharvsinh-codez wants to merge 1 commit into
Closed
Atharvsinh-codez wants to merge 1 commit into
Atharvsinh-codez wants to merge 1 commit into
Conversation
STT._recognize_impl wrote a `language` override back to self._opts, so a single recognize(language="fr") changed the language of every later recognize() and new stream. StreamAdapter passes its stream's language on every call, so a non-streaming OpenAI or Groq STT wrapped for a session ended up pinned to whatever language was last requested. Apply the override to a copy of the options for that request only, the same way stream() already does.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Author
|
Folded into #7828 together with the other two STT fixes and a fix for the flaky unit-tests failure. Closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openai.STT._recognize_implwrote a per-calllanguageback toself._opts, so onerecognize(buffer, language="fr")changed the language for every laterrecognize()call and every newstream()on that STT.This also hits the framework path. A non-streaming STT is wrapped in
StreamAdapter, andStreamAdapterpasses its stream's language to everyrecognize()call. Any STT built on the OpenAI plugin is affected, includinggroq.STTand the OpenAI-compatible providers. In that setup the STT stays on whatever language was requested last, and two streams with different languages overwrite each other's setting.The override now goes on a copy of the options for that one request, which is how
stream(language=...)already handles it. #6097 made the same fix for Clova.Test plan
test_file_transcription_language_override_applies_to_one_call. It fails onmain(the second request sendsfr) and passes with this change.uv run pytest tests/test_plugin_openai_stt_context.py tests/test_inference_stt_openai.py: 83 passed.groq.STTthe same way: the second request sendsen, and_opts.languagesstays["en"].livekit.plugins.openai,livekit.plugins.groq) are clean.