feat(deepgram): apply Flux option updates in-band#6277
Open
longcw wants to merge 1 commit into
Open
Conversation
Tunable Flux fields (eot_threshold, eager_eot_threshold, eot_timeout_ms, keyterms, language_hints) are now updated via a Configure control message instead of dropping and rebuilding the websocket. This avoids cutting the in-flight turn and the audio gap inherent to a reconnect. update_options sends only the fields that changed, and falls back to a reconnect for fields that can't be tuned in-band (model, sample_rate, mip_opt_out, tags, endpoint_url). Because keyterm updates no longer require a reconnect, session keyterm detection applies them immediately mid-utterance rather than deferring to end-of-turn. Fixes #6270
chenghao-mou
approved these changes
Jun 30, 2026
Comment on lines
+364
to
+370
| needs_reconnect = ( | ||
| is_given(model) | ||
| or is_given(sample_rate) | ||
| or is_given(mip_opt_out) | ||
| or is_given(tags) | ||
| or is_given(endpoint_url) | ||
| ) |
Member
There was a problem hiding this comment.
nit:
Suggested change
| needs_reconnect = ( | |
| is_given(model) | |
| or is_given(sample_rate) | |
| or is_given(mip_opt_out) | |
| or is_given(tags) | |
| or is_given(endpoint_url) | |
| ) | |
| needs_reconnect = any( | |
| is_given(opt) for opt in (model, sample_rate, mip_opt_out, tags, endpoint_url) | |
| ) |
| sample_rate: NotGivenOr[int] = NOT_GIVEN, | ||
| eot_threshold: NotGivenOr[float] = NOT_GIVEN, | ||
| eot_timeout_ms: NotGivenOr[int] = NOT_GIVEN, | ||
| keyterm: NotGivenOr[str | list[str]] = NOT_GIVEN, |
Member
There was a problem hiding this comment.
nit: should we change this type hint to be list only?
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.
Deepgram shipped a
Configurecontrol message for Flux that reconfigures an active session without reconnecting.update_options()now sends aConfiguremessage for the live-tunable fields (eot_threshold,eager_eot_threshold,eot_timeout_ms,keyterms,language_hints) instead of reconnecting, which avoids dropping the in-flight turn and the audio gap inherent to a reconnect. It sends only the fields that changed (Flux keeps omitted ones unchanged), and falls back to a reconnect for fields that cannot be tuned in-band (model,sample_rate,mip_opt_out,tags,endpoint_url).Because keyterm updates no longer require a reconnect, session keyterm detection now applies them immediately mid-utterance instead of deferring to end-of-turn.
See https://developers.deepgram.com/docs/flux/configure. This is Flux-only, so the v1
STTpath is unchanged.close #6270