File tree Expand file tree Collapse file tree
src/google/adk/flows/llm_flows Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments