Using Deepgram Audio Intelligence (Rust SDK)
Use this skill when the user wants transcript plus enrichment from audio, not a standalone text analysis request.
When to use this product
- Running summarization, topics, intents, sentiments, entity detection, paragraphs, search, diarization, or utterances against audio.
- Explaining that the Rust crate exposes these features through STT
Options, not a separate audio_intelligence module.
Authentication
Audio intelligence rides on the listen feature because it is implemented through prerecorded transcription.
[dependencies]
deepgram = { version = "0.10.0", default-features = false, features = ["listen"] }
tokio = { version = "1", features = ["full"] }
let dg = deepgram::Deepgram::new(std::env::var("DEEPGRAM_API_KEY")?)?;
Quick start
Quick start: prerecorded audio + intelligence flags
use deepgram::{
common::{
audio_source::AudioSource,
options::{Language, Options},
},
Deepgram,
};
use tokio::fs::File;
#[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 file = File::open("examples/audio/bueller.wav").await?;
let source = AudioSource::from_buffer_with_mime_type(file, "audio/wav");
let options = Options::builder()
.language(Language::en_US)
.punctuate(true)
.detect_entities(true)
.intents(true)
.sentiment(true)
.topics(true)
.summarize(true)
.paragraphs(true)
.utterances(true)
.diarize(true)
.build();
let response = dg.transcription().prerecorded(source, &options).await?;
println!("transcript: {}", response.results.channels[0].alternatives[0].transcript);
println!("summary: {:?}", response.results.summary);
println!("topics: {:?}", response.results.topics);
println!("intents: {:?}", response.results.intents);
println!("sentiments: {:?}", response.results.sentiments);
println!("entities: {:?}", response.results.channels[0].alternatives[0].entities);
Ok(())
}
Key parameters
- Intelligence flags on
common::options::OptionsBuilder: detect_entities, intents, sentiment, topics, summarize, paragraphs, utterances, diarize, search, keywords, keyterms, multichannel.
- Result locations:
response.results.summary
response.results.topics
response.results.intents
response.results.sentiments
response.results.channels[0].alternatives[0].entities
response.results.channels[0].alternatives[0].paragraphs
response.results.utterances
response.results.channels[0].search
API reference (layered)
- In-repo
src/common/options.rs
src/common/batch_response.rs
src/listen/rest.rs
examples/transcription/rest/prerecorded_from_file.rs
- OpenAPI
- Raw spec:
https://developers.deepgram.com/openapi.yaml
- Endpoint reference:
https://developers.deepgram.com/reference/speech-to-text/listen-pre-recorded
- AsyncAPI
- Usually not the primary source for full audio-intelligence response shapes in this crate
- Raw spec:
https://developers.deepgram.com/asyncapi.yaml
- Context7
/llmstxt/developers_deepgram_llms_txt
- Product docs
https://developers.deepgram.com/docs/audio-intelligence
Gotchas
- No separate Rust module exists. Audio intelligence is expressed as STT options plus prerecorded response fields.
- Use prerecorded for full coverage. The richest typed results live in
common::batch_response; live StreamResponse does not expose the same intelligence objects.
- Response fields are nested. Some features live on
results, others under channels[...].alternatives[...].
- Feature availability varies by API mode. The crate shares one
Options builder, but not every flag is equally meaningful for live streaming.
Example files in this repo
examples/transcription/rest/prerecorded_from_file.rs
examples/transcription/rest/prerecorded_from_url.rs
examples/transcription/rest/callback.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).
1---2name: deepgram-rust-audio-intelligence3description: 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.4---56# Using Deepgram Audio Intelligence (Rust SDK)78Use this skill when the user wants transcript plus enrichment from audio, not a standalone text analysis request.910## When to use this product1112- Running summarization, topics, intents, sentiments, entity detection, paragraphs, search, diarization, or utterances against audio.13- Explaining that the Rust crate exposes these features through STT `Options`, not a separate `audio_intelligence` module.1415## Authentication1617Audio intelligence rides on the `listen` feature because it is implemented through prerecorded transcription.1819```toml20[dependencies]21deepgram = { version = "0.10.0", default-features = false, features = ["listen"] }22tokio = { version = "1", features = ["full"] }23```2425```rust26let dg = deepgram::Deepgram::new(std::env::var("DEEPGRAM_API_KEY")?)?;27```2829## Quick start3031## Quick start: prerecorded audio + intelligence flags3233```rust34use deepgram::{35 common::{36 audio_source::AudioSource,37 options::{Language, Options},38 },39 Deepgram,40};41use tokio::fs::File;4243#[tokio::main]44async fn main() -> Result<(), Box<dyn std::error::Error>> {45 let api_key = std::env::var("DEEPGRAM_API_KEY")?;46 let dg = Deepgram::new(&api_key)?;4748 let file = File::open("examples/audio/bueller.wav").await?;49 let source = AudioSource::from_buffer_with_mime_type(file, "audio/wav");5051 let options = Options::builder()52 .language(Language::en_US)53 .punctuate(true)54 .detect_entities(true)55 .intents(true)56 .sentiment(true)57 .topics(true)58 .summarize(true)59 .paragraphs(true)60 .utterances(true)61 .diarize(true)62 .build();6364 let response = dg.transcription().prerecorded(source, &options).await?;6566 println!("transcript: {}", response.results.channels[0].alternatives[0].transcript);67 println!("summary: {:?}", response.results.summary);68 println!("topics: {:?}", response.results.topics);69 println!("intents: {:?}", response.results.intents);70 println!("sentiments: {:?}", response.results.sentiments);71 println!("entities: {:?}", response.results.channels[0].alternatives[0].entities);72 Ok(())73}74```7576## Key parameters7778- Intelligence flags on `common::options::OptionsBuilder`: `detect_entities`, `intents`, `sentiment`, `topics`, `summarize`, `paragraphs`, `utterances`, `diarize`, `search`, `keywords`, `keyterms`, `multichannel`.79- Result locations:80 - `response.results.summary`81 - `response.results.topics`82 - `response.results.intents`83 - `response.results.sentiments`84 - `response.results.channels[0].alternatives[0].entities`85 - `response.results.channels[0].alternatives[0].paragraphs`86 - `response.results.utterances`87 - `response.results.channels[0].search`8889## API reference (layered)90911. **In-repo**92 - `src/common/options.rs`93 - `src/common/batch_response.rs`94 - `src/listen/rest.rs`95 - `examples/transcription/rest/prerecorded_from_file.rs`962. **OpenAPI**97 - Raw spec: `https://developers.deepgram.com/openapi.yaml`98 - Endpoint reference: `https://developers.deepgram.com/reference/speech-to-text/listen-pre-recorded`993. **AsyncAPI**100 - Usually not the primary source for full audio-intelligence response shapes in this crate101 - Raw spec: `https://developers.deepgram.com/asyncapi.yaml`1024. **Context7**103 - `/llmstxt/developers_deepgram_llms_txt`1045. **Product docs**105 - `https://developers.deepgram.com/docs/audio-intelligence`106107## Gotchas1081091. **No separate Rust module exists.** Audio intelligence is expressed as STT options plus prerecorded response fields.1102. **Use prerecorded for full coverage.** The richest typed results live in `common::batch_response`; live `StreamResponse` does not expose the same intelligence objects.1113. **Response fields are nested.** Some features live on `results`, others under `channels[...].alternatives[...]`.1124. **Feature availability varies by API mode.** The crate shares one `Options` builder, but not every flag is equally meaningful for live streaming.113114## Example files in this repo115116- `examples/transcription/rest/prerecorded_from_file.rs`117- `examples/transcription/rest/prerecorded_from_url.rs`118- `examples/transcription/rest/callback.rs`119120## Central product skills121122For 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:123124```bash125npx skills add deepgram/skills126```127128This SDK ships language-idiomatic code skills; `deepgram/skills` ships cross-language product knowledge (see `api`, `docs`, `recipes`, `examples`, `starters`, `setup-mcp`).