Skip to content

fix(assemblyai): enforce 10-code language_codes cap on universal-3-6-pro - #8509

Merged
chenghao-mou merged 2 commits into
livekit:mainfrom
pylrn:fix/assemblyai-max-language-codes-universal-3-6-pro
Dec 2, 2026
Merged

chenghao-mou merged 2 commits into
livekit:mainfrom
pylrn:fix/assemblyai-max-language-codes-universal-3-6-pro

Conversation

@pylrn

@pylrn pylrn commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Enforce AssemblyAI's 10-code limit on language_codes across all models, including universal-3-6-pro.

Background & Reason

Previously, universal-3-6-pro was treated as having uncapped language_codes via _UNCAPPED_LANGUAGE_CODES_MODELS. However, AssemblyAI's streaming API strictly enforces a maximum of 10 language codes on Universal-3.6 Pro (as it does on all Universal-3 Pro models).

When 11 or more codes are supplied, the AssemblyAI WebSocket server rejects the connection (or runtime UpdateConfiguration) with:

{"type":"Error", "error_code":3006, "error":"User Input Validation Error: Invalid 'language_codes': Value error, Max 10 language codes"}

and abruptly terminates the WebSocket with error code 3006.

Mirroring this cap client-side prevents this runtime crash by raising a clear ValueError upfront during construction or update_options.

Changes

  • Removed _UNCAPPED_LANGUAGE_CODES_MODELS in livekit.plugins.assemblyai.stt.
  • Applied _MAX_LANGUAGE_CODES = 10 across all models in _normalize_language_codes.
  • Updated test test_language_codes_max_10_on_universal_3_6_pro in tests/test_plugin_assemblyai_stt.py to verify the 10-code validation on Universal-3.6 Pro.

@pylrn
pylrn requested a review from a team as a code owner November 11, 2026 10:08
@CLAassistant

CLAassistant commented Nov 11, 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: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@chenghao-mou

Copy link
Copy Markdown
Member

Thanks for the PR! Happy to merge it once the CLA is signed.

@pylrn

pylrn commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @chenghao-mou! CLA has been signed.

The AssemblyAI plugin applies the 10-code limit after normalization and deduplication.
@chenghao-mou
chenghao-mou merged commit 028bf7c into livekit:main Dec 2, 2026
14 checks passed
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.

3 participants