diff --git a/packages/services/voice-agent/src/plugins/speechmatics_stt.py b/packages/services/voice-agent/src/plugins/speechmatics_stt.py index edcf9cb..6219073 100644 --- a/packages/services/voice-agent/src/plugins/speechmatics_stt.py +++ b/packages/services/voice-agent/src/plugins/speechmatics_stt.py @@ -40,5 +40,9 @@ def create_speechmatics_stt(language: str = "cmn") -> speechmatics.STT: language=sm_lang, include_partials=True, ) + # Workaround: LiveKit's LanguageCode normalizes ISO 639-3 "cmn" back to + # ISO 639-1 "zh", but Speechmatics expects "cmn". Override the internal + # option after construction so the raw Speechmatics code is sent. + stt._stt_options.language = sm_lang # type: ignore[assignment] logger.info("Speechmatics STT created: language=%s (input=%s)", sm_lang, language) return stt