Skip to content

feat(deepgram): apply Flux option updates in-band#6277

Open
longcw wants to merge 1 commit into
mainfrom
longc/deepgram-flux-configure
Open

feat(deepgram): apply Flux option updates in-band#6277
longcw wants to merge 1 commit into
mainfrom
longc/deepgram-flux-configure

Conversation

@longcw

@longcw longcw commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Deepgram shipped a Configure control message for Flux that reconfigures an active session without reconnecting.

update_options() now sends a Configure message 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 STT path is unchanged.

close #6270

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
@longcw longcw requested a review from a team as a code owner June 30, 2026 07:03

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@chenghao-mou chenghao-mou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

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)
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we change this type hint to be list only?

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.

(deepgram) support in call param updates

2 participants