feat(flux)!: support flux-general-multi and mid-session reconfiguration (0.10.0)#159
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds multilingual Flux model support and introduces mid-session WebSocket reconfiguration capabilities to the Rust SDK, enabling callers to bias language detection and update thresholds/keyterms/hints without restarting a session.
Changes:
- Added
Model::FluxGeneralMultiplusOptionsBuilder::language_hintto send repeatedlanguage_hint=...query parameters. - Extended
FluxResponsewith per-turnlanguages/languages_hintedand newConfigureSuccess/ConfigureFailureresponses (includingConfigureThresholds). - Introduced
FluxHandle::configure(ConfigureRequest)and added two new Flux examples demonstrating multilingual usage and dynamic configuration.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/listen/flux.rs | Adds ConfigureRequest, wire-message serialization, and FluxHandle::configure support in the WS worker. |
| src/common/options.rs | Adds FluxGeneralMulti model and language_hint option serialization as repeated query params. |
| src/common/flux_response.rs | Adds new Flux response variants/fields and threshold type with round-trip tests. |
| examples/transcription/flux/multi_language.rs | New example demonstrating multilingual Flux + language hints and printing detected languages. |
| examples/transcription/flux/dynamic_configure.rs | New example demonstrating sending Configure mid-session and handling acknowledgements. |
| Cargo.toml | Registers the two new examples behind the listen feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b3f0b5e to
35a00e9
Compare
35a00e9 to
d2b41a1
Compare
Adds the API surface needed to use Deepgram's multilingual Flux model from the Rust SDK: - Model::FluxGeneralMulti selects the multilingual model. - OptionsBuilder::language_hint takes an iterable of BCP-47 codes, emitted as repeated language_hint=... query params per spec. - FluxResponse::TurnInfo now exposes languages (detected on the turn) and languages_hinted (the hints that were active for the request). The variant is now #[non_exhaustive] so future field additions stay backwards-compatible. - FluxHandle::configure(ConfigureRequest) lets callers adjust thresholds, keyterms, and language hints without tearing down the WebSocket. Server replies surface as FluxResponse::ConfigureSuccess or ConfigureFailure. ConfigureRequest fields are all optional so unset fields mean "leave unchanged"; ConfigureThresholds groups eager_eot_threshold / eot_threshold / eot_timeout_ms. ConfigureRequest is #[non_exhaustive] so callers should construct it via new() + with_* builder methods. Bumps version to 0.10.0 because adding fields to the existing FluxResponse::TurnInfo struct variant (and marking it #[non_exhaustive]) are breaking changes in pre-1.0 Cargo semver. BREAKING CHANGE: FluxResponse::TurnInfo gained two new fields (languages, languages_hinted) and is now #[non_exhaustive]. Callers that destructured TurnInfo with a literal struct pattern need to add `..` or name the new fields. Examples: - examples/transcription/flux/multi_language.rs - flux-general-multi with hints, prints the languages Flux returned per turn. - examples/transcription/flux/dynamic_configure.rs - sends Configure mid-session and prints the ConfigureSuccess reply.
d2b41a1 to
6684904
Compare
lukeocodes
approved these changes
May 12, 2026
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.
Summary
Model::FluxGeneralMulti,OptionsBuilder::language_hint, and thelanguages/languages_hintedfields onFluxResponse::TurnInfoso callers can use Deepgram's multilingual Flux model from the Rust SDK.FluxHandle::configure(ConfigureRequest)for mid-session reconfiguration of thresholds, keyterms, and language hints; server replies surface asFluxResponse::ConfigureSuccess/ConfigureFailure. BothConfigureRequestandFluxResponse::TurnInfoare now#[non_exhaustive]so future fields stay backwards-compatible.examples/transcription/flux/multi_language.rsandexamples/transcription/flux/dynamic_configure.rs.examples/audio/bueller-mono.wav(mono Linear16 downmix of the existingbueller.wav) so the Flux examples have enough audio + trailing silence to actually triggerEndOfTurnagainst the live server. Flux is mono-only at the API.FluxResponse::TurnInfogained two new fields (languages,languages_hinted) and is now#[non_exhaustive]. Callers that destructuredTurnInfowith a literal struct pattern need to add..or name the new fields. In pre-1.0 Cargo semver, this requires a0.9.x → 0.10.0bump.Test plan
cargo test --all-features— 61 unit + 3 integration + 136 doctests passing (1 integration test ignored, gated on a live API key)cargo clippy --all-features --all-targets -- -D warningscleancargo fmt --checkcleancargo build --example flux_multi_language --example flux_dynamic_configure --features listenbuilds cleanflux_multi_languageruns end-to-end live:StartOfTurnarrives withlanguages_hinted=["en", "es"],EndOfTurnarrives withDetected languages: ["en"]— both newTurnInfofields deserialize correctly off the wireflux_dynamic_configureruns end-to-end live: after firstEndOfTurn, sendsConfigure { eot_threshold: 0.85, keyterms: ["weather", "forecast"] }, server returnsConfigureSuccesswith the echoed values