Repository navigation
0.10.1
Release 0.10.1
Added
- Flux text-to-speech (
/v2/speak) support in the newspeak::fluxmodule:- Batch (REST):
Speak::flux_speak_to_fileandSpeak::flux_speak_to_streamsynthesize a complete block of text withPOST /v2/speak. Query options covermodel(required, e.g.Model::FluxHaleyEn),encoding,sample_rate,speed,expressivity,mip_opt_out,tag, and the REST-onlycontainer,bit_rate,callback,callback_method, andpriority. - Streaming (WebSocket):
Speak::flux_request(options).handle()connects to the/v2/speakwebsocket and returns aFluxSpeakHandlewithspeak,flush,interrupt,configure_speed,close, andreceive. Server events surface asFluxSpeakResponse: binaryAudioframes plusConnected,SpeechStarted,Flushed,SpeechMetadata,SpeechInterrupted,SessionMetadata,ConfigureSuccess/ConfigureFailure,Warning,FatalError, and a forward-compatibleUnknown. - The websocket rejects REST-only options and the REST-only compressed encodings (
mp3,opus,flac,aac) up front with the newDeepgramError::InvalidOptionsvariant; custom encodings are left for the server to validate. - New examples:
flux_tts_batchandflux_tts_websocketunderexamples/speak/flux/.
- Batch (REST):
FluxHandle::force_end_turn()sends theForceEndTurncontrol message to end the current turn immediately on an external signal (push-to-talk release, DTMF tone, UI event, or an external endpointing stack). Sent while no turn is active, it is silently ignored.FluxResponse::TurnInfonow exposestrigger(Option<TurnTrigger>), the cause of a turn ending, reported onEndOfTurnevents:Model(native end-of-turn detection),Manual(aForceEndTurnwas sent), orTimeout(eot_timeout_mselapsed).TurnTriggeris an open enum — unrecognized values deserialize asTurnTrigger::Unknown(String), preserving the original wire value so it survives re-serialization.FluxWordnow exposes optional per-wordstartandendtimings, in seconds.- New example:
flux_force_end_turnunderexamples/transcription/flux/. - Opt-in connect diagnostics behind the new
connect-diagnosticscargo feature, for live transcription (/v1/listen) WebSocket connections (other WebSocket surfaces are not covered yet). Configuring a sink viaWebsocketBuilder::diagnosticsmakes the SDK establish the streaming connection in four individually timed phases (DNS, TCP connect, TLS handshake, WebSocket upgrade) and emit onediagnostics::ConnectRecordper connect attempt. New example:connect_diagnostics.- Records are emitted for every attempt — including attempts cancelled by a caller-side
tokio::time::timeout, and failed upgrades, which capture thedg-request-idanddg-errorresponse headers. - Records serialize to flat JSON for JSONL pipelines (
schema_version: 1, additive-only). The recorded URL is reduced to scheme, host, port, and path — userinfo and query parameters are never persisted. - TLS note: with the feature enabled, both the timed and the untimed
/v1/listenconnect paths are handed one explicit rustls connector (webpki trust roots, crate-default provider), so downstream feature unification — e.g. a consumer also enablingtokio-tungstenite/native-tls— cannot make the two paths select different TLS providers. Without the feature, the stock connect path runs unchanged.
- Records are emitted for every attempt — including attempts cancelled by a caller-side
Changed
- The
speakfeature now enables the websocket dependencies (tungstenite,tokio-tungstenite), andDeepgramError::WsErroris available underspeakas well aslisten. No API change for default-feature users.
Fixed
- The Flux connection workers (STT and TTS) now end on the first terminal transport error (forwarding it exactly once) and complete the WebSocket closing handshake promptly when the server initiates the close, instead of leaving the close acknowledgement queued until socket teardown. After the session ends — peer close or terminal error — sends from the handle (
FluxHandle::send_data/configure/force_end_turn,FluxSpeakHandle::speak/flush/interrupt/configure_speed) return an error instead of silently discarding the message.
Full changelog: 0.10.0...0.10.1