Repository navigation
fix(assemblyai): honor the language passed to STT.stream() - #8472
Open
anubhavlal07 wants to merge 1 commit into
Open
anubhavlal07 wants to merge 1 commit into
anubhavlal07 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
STT.stream(language=...)inlivekit-plugins-assemblyaiacceptedlanguagebut ignored it. The stream was always built from the plugin-levellanguage_codes, so a per-stream language never reached AssemblyAI's language steering.Fix: on the Universal-3 Pro family (
_U3_PRO_MODELS, the models that acceptlanguage_codes),stream()sets that stream'slanguage_codesfromlanguage. It goes through the existing_normalize_language_codes, so"es-ES"becomes["es"]. The override is on thedataclasses.replacecopy the stream already takes, so the provider's options and other streams are unchanged. An emptylanguagemeans no override.On other models, which reject
language_codesat construction, the override is logged and skipped rather than sent, matching the constructor's restriction.This is the same gap #8374 fixed for AWS.
Test: two cases.
test_stream_language_steers_that_stream_only: an override stream gets["es"], while a default stream and an empty override keep["en"], and the provider keeps["en"]. This fails onmain.test_stream_language_ignored_without_language_steering_support: onuniversal-streaming-english, nothing is set.All of
tests/test_plugin_assemblyai_stt.pypasses (127 tests), andruff checkandruff format --checkare clean.This change was prepared with the help of an AI assistant (Claude), and I reviewed and tested it.