Skip to content

ElevenLabs STT: add secondary_languages support - #6944

Closed
rrfunde wants to merge 1 commit into
livekit:mainfrom
rrfunde:fix/elevenlabs-stt-secondary-languages
Closed

ElevenLabs STT: add secondary_languages support#6944
rrfunde wants to merge 1 commit into
livekit:mainfrom
rrfunde:fix/elevenlabs-stt-secondary-languages

Conversation

@rrfunde

@rrfunde rrfunde commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a secondary_languages: NotGivenOr[list[str]] option to the ElevenLabs STT plugin, letting bilingual applications constrain speech prediction to a limited set of languages alongside language_code.
  • Forwarded as repeated form fields for batch requests and repeated secondary_languages query params for Scribe v2 realtime sessions (mirroring how keyterms are handled).
  • Supported in the constructor, update_options() (with reconnect propagation to live realtime streams), and both STTOptions.

Fixes #6920

Testing

  • New unit tests in tests/test_plugin_elevenlabs_stt.py: connect URL includes repeated secondary_languages params, omitted when NOT_GIVEN, defaults, and option updates.
  • uv run pytest tests/test_plugin_elevenlabs_stt.py — 29 passed
  • ruff format/check and mypy clean

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
@rrfunde
rrfunde requested a review from a team as a code owner August 22, 2026 07:15
@CLAassistant

CLAassistant commented Aug 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@tinalenguyen tinalenguyen 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.

hi, thanks for the pr! could we gate this param on the realtime path and throw a warning for the batch path?

tinalenguyen added a commit that referenced this pull request Aug 31, 2026
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.
@rrfunde

rrfunde commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review — agreed, gating on the realtime path is right. The batch endpoint does not accept secondary_languages, so the current diff silently sends a param the API ignores; the docstring already says "Supported for Scribe v2 realtime" and the code should enforce it.

I noticed you pushed tina/11labs-secondary-languages (a113ddc) doing exactly that — warn-and-drop at construction and in update_options, never added to the batch form. Happy either way: if you would rather land that one, feel free to close this in its favour. Otherwise I will apply the same gating here and push to this branch — just let me know which you prefer so we do not duplicate the work.

@tinalenguyen

Copy link
Copy Markdown
Member

closing this PR since i took over in #7086 which has been merged! this will be available in the next release

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"secondary_languages" parameter in ElevenLabs STT plugin

3 participants