con un clic
deepgram-rust-conversational-stt
// Use when implementing Deepgram Flux conversational STT from the Rust SDK, including flux_request APIs, turn events, FluxResponse handling, and turn-detection tuning for voice-agent-style pipelines.
// Use when implementing Deepgram Flux conversational STT from the Rust SDK, including flux_request APIs, turn events, FluxResponse handling, and turn-detection tuning for voice-agent-style pipelines.
| name | deepgram-rust-conversational-stt |
| description | Use when implementing Deepgram Flux conversational STT from the Rust SDK, including flux_request APIs, turn events, FluxResponse handling, and turn-detection tuning for voice-agent-style pipelines. |
Use this skill for Deepgram Flux, the crate's supported turn-based conversational streaming path.
TurnEvent::{StartOfTurn, EndOfTurn, EagerEndOfTurn, TurnResumed, Update}.eot_threshold, eager_eot_threshold, and eot_timeout_ms.Flux is under the listen feature.
[dependencies]
deepgram = { version = "0.10.0", default-features = false, features = ["listen"] }
tokio = { version = "1", features = ["full"] }
futures = "0.3"
let dg = deepgram::Deepgram::new(std::env::var("DEEPGRAM_API_KEY")?)?;
use std::{io::Write, time::Duration};
use deepgram::{
common::{
flux_response::{FluxResponse, TurnEvent},
options::{Encoding, Model, Options},
},
Deepgram,
};
use futures::stream::StreamExt;
static PATH_TO_FILE: &str = "examples/audio/sample-mono.wav";
static AUDIO_CHUNK_SIZE: usize = 18_063;
static FRAME_DELAY: Duration = Duration::from_millis(100);
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = std::env::var("DEEPGRAM_API_KEY")?;
let dg = Deepgram::new(&api_key)?;
let options = Options::builder()
.model(Model::FluxGeneralEn)
.eot_threshold(0.75)
.eot_timeout_ms(5000)
.keyterms(["activate", "cancel"])
.build();
let mut results = dg
.transcription()
.flux_request_with_options(options)
.encoding(Encoding::Linear32)
.sample_rate(44100)
.file(PATH_TO_FILE, AUDIO_CHUNK_SIZE, FRAME_DELAY)
.await?;
println!("Flux Request ID: {}", results.request_id());
while let Some(result) = results.next().await {
match result? {
FluxResponse::Connected { request_id, sequence_id } => {
println!("Connected: {request_id} (seq: {sequence_id})");
}
FluxResponse::TurnInfo { event, turn_index, transcript, end_of_turn_confidence, .. } => {
match event {
TurnEvent::StartOfTurn => println!("▶ [Turn {turn_index}] START"),
TurnEvent::EndOfTurn => println!("✓ [Turn {turn_index}] END ({end_of_turn_confidence:.2}): {transcript}"),
TurnEvent::Update => {
if !transcript.is_empty() {
print!("\r[Turn {turn_index}] UPDATE: {transcript}");
std::io::stdout().flush().unwrap();
}
}
_ => {}
}
}
FluxResponse::FatalError { code, description, .. } => {
eprintln!("{code}: {description}");
break;
}
FluxResponse::Unknown(value) => println!("unknown: {value}"),
}
}
Ok(())
}
flux_request(), flux_request_with_options(options).encoding, sample_rate, then .file(...), .stream(...), or .handle().await?.OptionsBuilder: model(Model::FluxGeneralEn), eot_threshold, eager_eot_threshold, eot_timeout_ms, keyterms.common::flux_response::FluxResponse.src/listen/flux.rssrc/common/flux_response.rssrc/common/options.rsexamples/transcription/flux/simple_flux.rstests/flux_unknown_messages.rstests/flux_e2e.rshttps://developers.deepgram.com/openapi.yamlhttps://developers.deepgram.com/reference/speech-to-text/listen-fluxhttps://developers.deepgram.com/asyncapi.yaml/llmstxt/developers_deepgram_llms_txthttps://developers.deepgram.com/docs/stt/getting-startedModel::FluxGeneralEn.FluxResponse::Unknown and TurnEvent::Unknown are there for forward compatibility; handle them instead of assuming exhaustiveness.examples/transcription/flux/simple_flux.rsexamples/transcription/flux/simple_flux_token.rsexamples/transcription/flux/microphone_flux.rstests/flux_unknown_messages.rstests/flux_e2e.rsFor cross-language Deepgram product knowledge — the consolidated API reference, documentation finder, focused runnable recipes, third-party integration examples, and MCP setup — install the central skills:
npx skills add deepgram/skills
This SDK ships language-idiomatic code skills; deepgram/skills ships cross-language product knowledge (see api, docs, recipes, examples, starters, setup-mcp).
Use when implementing Deepgram audio intelligence from the Rust SDK, especially when intelligence features are attached to STT Options and batch responses instead of a separate audio-intelligence module.
Use when implementing Deepgram project, key, member, scope, billing, invitation, or usage operations from the Rust SDK, including manage feature flags and the real Deepgram::projects/keys/members/scopes/billing/usage APIs.
Use when implementing Deepgram speech-to-text in the Rust SDK, including prerecorded REST transcription, live WebSocket streaming, listen feature flags, Options builder usage, and response handling.
Use when implementing Deepgram text-to-speech in the Rust SDK, including Aura model selection, speak feature flags, output file or byte-stream handling, and real crate APIs under speak::options and Speak.
Use when a user asks for Deepgram text intelligence from Rust. Route to raw HTTP guidance because this crate does not currently expose a dedicated /v1/read client or typed text-intelligence module.
Use when a user asks for Deepgram Voice Agent support from Rust. Route honestly: this crate does not currently expose the Agent WebSocket API, reusable agent configurations, or typed voice-agent events.