Repository navigation
fix(realtime): strip EOU language tags from the LLM context - #12750
nexxtmobile wants to merge 2 commits into
Conversation
|
@mudler Code-review sign-off at |
ASR backends like Nemotron-3.5 append end-of-utterance language tags to
transcripts ("<de-DE>", "<en-US>", ...). The committed transcript feeds
the LLM conversation (the user item Transcript field), but the per-utterance
tag is unreliable for short/ambiguous utterances (a German "Hallo." tagged
<en-US>) and the LLM treats it as a language signal, switching the reply
language against the session instructions.
commitUtteranceWithTranscript now strips the EOU tags from the transcript
that goes to appendUserItem/generateResponse (the LLM context). The emitted
input_audio_transcription event keeps the raw transcript (debugging /
client display).
Regression tests: stripEOULanguageTags unit specs + a client-commit spec
asserting the emitted event keeps the raw tag while the LLM user message is
tag-free.
Signed-off-by: nexxtmobile.de <git@nexxtmobile.de>
75b8bf9 to
dff4880
Compare
Assisted-by: Codex:gpt-6 Signed-off-by: nexxtmobile.de <git@nexxtmobile.de>
|
Update: rebased onto Note on the doc commit: a rebase force-push clobbered the maint-bot's doc commit ( |
Fixes #12748
ASR backends like Nemotron-3.5 append end-of-utterance language tags to
transcripts (
"Hallo. <en-US>"). The committed transcript feeds the LLMconversation verbatim (user item
Transcriptfield), and the per-utterancetag is unreliable for short/ambiguous utterances — the LLM treats it as a
language signal and switches the reply language against the session
instructions (observed: German "Hallo." tagged
<en-US>→ English reply ina German call).
commitUtteranceWithTranscriptnow strips the EOU tags from the transcriptthat goes to
appendUserItem/generateResponse(the LLM context). Theemitted
input_audio_transcriptionevent keeps the raw transcript(debugging / client display).
Includes regression specs:
stripEOULanguageTagsunit specs + a client-commitspec asserting the emitted event keeps the raw tag while the LLM user message
is tag-free.
Tested:
go test -race ./core/http/endpoints/openai/green (Go 1.26).