(gladia & soniox): add translation support#5148
Merged
tinalenguyen merged 5 commits intomainfrom Mar 20, 2026
Merged
Conversation
Closed
9 tasks
MSameerAbbas
added a commit
to MSameerAbbas/agents
that referenced
this pull request
Mar 20, 2026
…dpoint Emit END_OF_SPEECH based on speaking state, not final text presence. Previously both were inside the same conditional, so if an error or finished message arrived while speaking but before final tokens accumulated, END_OF_SPEECH was skipped. This left downstream consumers in speaking state with no turn detection triggered. Only affects agents using turn_detection=stt (no VAD). Pre-existing bug also present on main and livekit#5148.
chenghao-mou
approved these changes
Mar 20, 2026
Member
chenghao-mou
left a comment
There was a problem hiding this comment.
lgtm. One small thing I noticed is that the translation works with code-switching, but the source/input language only supports one value.
| input_language: LanguageCode | None = None | ||
| """the detected/input language spoken by the user. populated by STT services that support translation, | ||
| where `language` holds the target language and `input_language` holds the original spoken language""" | ||
| input_text: str | None = None |
Member
There was a problem hiding this comment.
nit: borrowing terms from machine translation terminology, we should name them source_language, and source_text.
Member
Author
There was a problem hiding this comment.
I renamed to source_languages and source_texts, for the polyglots
| # Reset speaking state, so the next transcript will send START_OF_SPEECH again. | ||
| is_speaking = False | ||
| else: | ||
| final_original.reset() |
Member
There was a problem hiding this comment.
I don't think we need to reset this here
MSameerAbbas
added a commit
to MSameerAbbas/agents
that referenced
this pull request
Mar 20, 2026
…dpoint Emit END_OF_SPEECH based on speaking state, not final text presence. Previously both were inside the same conditional, so if an error or finished message arrived while speaking but before final tokens accumulated, END_OF_SPEECH was skipped. This left downstream consumers in speaking state with no turn detection triggered. Only affects agents using turn_detection=stt (no VAD). Pre-existing bug also present on main and livekit#5148.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add
input_languageandinput_texttoSpeechDataand add translation support for gladia and sonioxcloses #4943 and #4402
to test, iterate through STT node: