Skip to content

Commit c426c48

Browse files
google-genai-botcopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 822754668
1 parent f1e01ea commit c426c48

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/google/adk/flows/llm_flows/contents.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def _is_live_model_audio_event(event: Event) -> bool:
639639
Part(
640640
inline_data=Blob(
641641
data=b'\x01\x00\x00...',
642-
mime_type='audio/pcm'
642+
mime_type='audio/pcm;rate=24000'
643643
)
644644
),
645645
],
@@ -653,9 +653,17 @@ def _is_live_model_audio_event(event: Event) -> bool:
653653
return False
654654
# If it's audio data, then one event only has one part of audio.
655655
for part in event.content.parts:
656-
if part.inline_data and part.inline_data.mime_type == 'audio/pcm':
656+
if (
657+
part.inline_data
658+
and part.inline_data.mime_type
659+
and part.inline_data.mime_type.startswith('audio/')
660+
):
657661
return True
658-
if part.file_data and part.file_data.mime_type == 'audio/pcm':
662+
if (
663+
part.file_data
664+
and part.file_data.mime_type
665+
and part.file_data.mime_type.startswith('audio/')
666+
):
659667
return True
660668
return False
661669

0 commit comments

Comments
 (0)