Skip to content

feat(flux)!: support flux-general-multi and mid-session reconfiguration (0.10.0)#159

Merged
GregHolmes merged 1 commit into
mainfrom
feat/flux-multilingual
May 12, 2026
Merged

feat(flux)!: support flux-general-multi and mid-session reconfiguration (0.10.0)#159
GregHolmes merged 1 commit into
mainfrom
feat/flux-multilingual

Conversation

@GregHolmes

@GregHolmes GregHolmes commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Model::FluxGeneralMulti, OptionsBuilder::language_hint, and the languages / languages_hinted fields on FluxResponse::TurnInfo so callers can use Deepgram's multilingual Flux model from the Rust SDK.
  • Adds FluxHandle::configure(ConfigureRequest) for mid-session reconfiguration of thresholds, keyterms, and language hints; server replies surface as FluxResponse::ConfigureSuccess / ConfigureFailure. Both ConfigureRequest and FluxResponse::TurnInfo are now #[non_exhaustive] so future fields stay backwards-compatible.
  • Two new examples: examples/transcription/flux/multi_language.rs and examples/transcription/flux/dynamic_configure.rs.
  • Adds examples/audio/bueller-mono.wav (mono Linear16 downmix of the existing bueller.wav) so the Flux examples have enough audio + trailing silence to actually trigger EndOfTurn against the live server. Flux is mono-only at the API.
  • Bumps version to 0.10.0.

⚠️ 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. In pre-1.0 Cargo semver, this requires a 0.9.x → 0.10.0 bump.

Note on the big branch: feat/agent-websocket (the Phase 1–10 spec-coverage branch) was also targeting 0.10.0. Once this PR ships, the big branch will rebase and target 0.11.0 instead.

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 warnings clean
  • cargo fmt --check clean
  • cargo build --example flux_multi_language --example flux_dynamic_configure --features listen builds clean
  • flux_multi_language runs end-to-end live: StartOfTurn arrives with languages_hinted=["en", "es"], EndOfTurn arrives with Detected languages: ["en"] — both new TurnInfo fields deserialize correctly off the wire
  • flux_dynamic_configure runs end-to-end live: after first EndOfTurn, sends Configure { eot_threshold: 0.85, keyterms: ["weather", "forecast"] }, server returns ConfigureSuccess with the echoed values

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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::FluxGeneralMulti plus OptionsBuilder::language_hint to send repeated language_hint=... query parameters.
  • Extended FluxResponse with per-turn languages / languages_hinted and new ConfigureSuccess / ConfigureFailure responses (including ConfigureThresholds).
  • 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.

Comment thread src/listen/flux.rs
Comment thread src/listen/flux.rs
Comment thread src/common/options.rs
@GregHolmes GregHolmes force-pushed the feat/flux-multilingual branch 6 times, most recently from b3f0b5e to 35a00e9 Compare May 11, 2026 13:22
@GregHolmes GregHolmes changed the title feat(flux): support flux-general-multi and mid-session reconfiguration feat(flux)!: support flux-general-multi and mid-session reconfiguration (0.10.0) May 11, 2026
@GregHolmes GregHolmes force-pushed the feat/flux-multilingual branch from 35a00e9 to d2b41a1 Compare May 11, 2026 13:23
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.
@GregHolmes GregHolmes force-pushed the feat/flux-multilingual branch from d2b41a1 to 6684904 Compare May 11, 2026 13:30
@GregHolmes GregHolmes merged commit 52711b7 into main May 12, 2026
18 checks passed
@GregHolmes GregHolmes deleted the feat/flux-multilingual branch May 12, 2026 10:01
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.

3 participants