Skip to main content

parse_gemini_interaction_audio

Function parse_gemini_interaction_audio 

Source
pub fn parse_gemini_interaction_audio(json: &Value) -> GeminiAudioBlock
Expand description

Extract the last audio block (decoded from base64) from an Interactions API response.

REST shape: steps[*].content[*] blocks with type == "audio" carry data (base64) and mime_type (audio/wav). The last audio block matches the SDK’s output_audio convenience property. Base64 corruption is reported distinctly from absence so the caller can produce an accurate diagnostic.