This guide covers the breaking API change in Deepgram Rust SDK 0.14.0.
Upgrade the crate to the latest 0.14 release:
cargo add deepgram@0.14Or update your Cargo.toml directly:
[dependencies]
deepgram = "0.14"Then update the lockfile:
cargo update -p deepgramWebSocket upgrade responses can omit the dg-request-id header. In 0.14.0,
the following accessors therefore return Option<Uuid> instead of Uuid:
WebsocketHandle::request_idTranscriptionStream::request_idFluxHandle::request_idFluxStream::request_idFluxSpeakHandle::request_id
Update code that assumed every connection had an ID. For example, replace:
let request_id = handle.request_id();
println!("Deepgram request ID: {request_id}");with explicit absent-value handling:
match handle.request_id() {
Some(request_id) => println!("Deepgram request ID: {request_id}"),
None => eprintln!("The WebSocket upgrade did not include dg-request-id"),
}None means only that the server omitted the header. A present
dg-request-id header that is not a UUID remains an
DeepgramError::UnexpectedServerResponse error.