Repository navigation
fix(elevenlabs): don't persist the per-call language passed to recognize() - #7822
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
…ize() STT._recognize_impl wrote a `language` override to self._opts.language_code, so one recognize(language="fr") changed the language of every later batch request, the default language of new streams, and the fallback language reported on transcripts. StreamAdapter passes its stream's language on every call, so a wrapped batch STT stayed on the last language it was asked for. Use the override for that request only.
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
elevenlabs.STT._recognize_implwrote a per-calllanguagetoself._opts.language_code. Onerecognize(buffer, language="fr")therefore changed three things:frstream()calls started infr, because that is their defaultlanguage_codein the response were tagged with the last overrideThis is reachable without calling
recognize()directly, becauseStreamAdapterpasses its stream's language on every call. A batch Scribe STT wrapped for a session stays on the last language it was asked for.The override now applies only to the request it was passed with. #6097 made the same fix for Clova, and #7820 makes it for OpenAI.
Test plan
test_recognize_language_override_applies_to_one_call. It uses the existingTestServersetup and checks thelanguage_codeform field of two consecutive requests. It fails onmain(['fr', 'fr']) and passes with this change (['fr', 'en']).uv run pytest tests/test_plugin_elevenlabs_stt.py --plugin elevenlabs: 109 passed.livekit.plugins.elevenlabs) are clean.