From c426c48005c597aeda3d6b32af9c883af1042145 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Wed, 22 Oct 2025 15:06:22 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 822754668 --- src/google/adk/flows/llm_flows/contents.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/google/adk/flows/llm_flows/contents.py b/src/google/adk/flows/llm_flows/contents.py index 3c4da720..be471a44 100644 --- a/src/google/adk/flows/llm_flows/contents.py +++ b/src/google/adk/flows/llm_flows/contents.py @@ -639,7 +639,7 @@ def _is_live_model_audio_event(event: Event) -> bool: Part( inline_data=Blob( data=b'\x01\x00\x00...', - mime_type='audio/pcm' + mime_type='audio/pcm;rate=24000' ) ), ], @@ -653,9 +653,17 @@ def _is_live_model_audio_event(event: Event) -> bool: return False # If it's audio data, then one event only has one part of audio. for part in event.content.parts: - if part.inline_data and part.inline_data.mime_type == 'audio/pcm': + if ( + part.inline_data + and part.inline_data.mime_type + and part.inline_data.mime_type.startswith('audio/') + ): return True - if part.file_data and part.file_data.mime_type == 'audio/pcm': + if ( + part.file_data + and part.file_data.mime_type + and part.file_data.mime_type.startswith('audio/') + ): return True return False