deepgram/deepgram-rust-sdk · Archived

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.

First seen May 31, 2026

Installation

$ npx skills add deepgram/deepgram-rust-sdk --skill deepgram-rust-conversational-stt

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from deepgram/deepgram-rust-sdk.

npx skills add deepgram/deepgram-rust-sdk

Browse all from deepgram/deepgram-rust-sdk

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 66
License LICENSE
Default branch main
Open issues 14
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,712 B
  • docs SUMMARY.md 237 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 7 installs

SKILL.md

Using Deepgram Conversational STT (Rust SDK)

Use this skill for Deepgram Flux, the crate's supported turn-based conversational streaming path.

When to use this product

  • Building turn-based STT for voice-agent pipelines.
  • Handling TurnEvent::{StartOfTurn, EndOfTurn, EagerEndOfTurn, TurnResumed, Update}.
  • Tuning end-of-turn behavior with eotthreshold, eagereotthreshold, and eottimeout_ms.

Authentication

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")?)?;

Quick start

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

Key parameters

  • Entrypoints: fluxrequest(), fluxrequestwithoptions(options).
  • Flux transport builder fields: encoding, sample_rate, then .file(...), .stream(...), or .handle().await?.
  • Flux-specific tuning in shared OptionsBuilder: model(Model::FluxGeneralEn), eotthreshold, eagereotthreshold, eottimeout_ms, keyterms.
  • Main response type: common::flux_response::FluxResponse.

API reference (layered)

  1. In-repo

- src/listen/flux.rs - src/common/fluxresponse.rs - src/common/options.rs - examples/transcription/flux/simpleflux.rs - tests/fluxunknownmessages.rs - tests/flux_e2e.rs

  1. OpenAPI

- Raw spec: https://developers.deepgram.com/openapi.yaml - Endpoint reference: https://developers.deepgram.com/reference/speech-to-text/listen-flux

  1. AsyncAPI

- Raw spec: https://developers.deepgram.com/asyncapi.yaml - Flux channel docs are surfaced from the same product reference page above

  1. Context7

- /llmstxt/developersdeepgramllms_txt

  1. Product docs

- https://developers.deepgram.com/docs/stt/getting-started

Gotchas

  1. Flux is English-only in this crate's model surface. The default supported model is Model::FluxGeneralEn.
  2. Real-time pacing matters even more than standard streaming. The example warns that bad chunk size / delay values can break turn detection.
  3. Unknown events are intentional. FluxResponse::Unknown and TurnEvent::Unknown are there for forward compatibility; handle them instead of assuming exhaustiveness.
  4. Use Flux for turn-taking, not full agent control. If you need TTS replies, prompts, or tool calls, that is Voice Agent territory and not a typed Rust SDK surface yet.

Example files in this repo

  • examples/transcription/flux/simple_flux.rs
  • examples/transcription/flux/simplefluxtoken.rs
  • examples/transcription/flux/microphone_flux.rs
  • tests/fluxunknownmessages.rs
  • tests/flux_e2e.rs

Central product skills

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