ElevenLabs STT: add secondary_languages support - #6944
Conversation
Adds a `secondary_languages` option (list of language codes) to the ElevenLabs STT plugin, forwarded as repeated form fields for batch requests and repeated query params for Scribe v2 realtime sessions. This lets bilingual applications constrain speech prediction to a limited set of languages for better accuracy. Fixes livekit#6920
tinalenguyen
left a comment
There was a problem hiding this comment.
hi, thanks for the pr! could we gate this param on the realtime path and throw a warning for the batch path?
Lets bilingual apps constrain speech prediction to a limited set of languages alongside language_code, sent as repeated secondary_languages query params on the realtime connect URL (mirroring keyterms). The batch speech-to-text endpoint does not accept the param, so it is gated on the realtime path: a non-realtime model drops it with a warning at construction and in update_options, and it is never added to the batch request form. Based on #6944.
|
Thanks for the review — agreed, gating on the realtime path is right. The batch endpoint does not accept I noticed you pushed |
|
closing this PR since i took over in #7086 which has been merged! this will be available in the next release |
Summary
secondary_languages: NotGivenOr[list[str]]option to the ElevenLabs STT plugin, letting bilingual applications constrain speech prediction to a limited set of languages alongsidelanguage_code.secondary_languagesquery params for Scribe v2 realtime sessions (mirroring howkeytermsare handled).update_options()(with reconnect propagation to live realtime streams), and bothSTTOptions.Fixes #6920
Testing
tests/test_plugin_elevenlabs_stt.py: connect URL includes repeatedsecondary_languagesparams, omitted when NOT_GIVEN, defaults, and option updates.uv run pytest tests/test_plugin_elevenlabs_stt.py— 29 passedruff format/checkandmypyclean