Skip to content

Commit 68402bd

Browse files
hangfeicopybara-github
authored andcommitted
fix: Set default response modality to AUDIO in run_session
Some native audio models require the modality to be set, so we default to AUDIO if not specified in `RunConfig`. PiperOrigin-RevId: 815952039
1 parent 90e1e3e commit 68402bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/google/adk/runners.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ async def run_live(
617617
Either `session` or both `user_id` and `session_id` must be provided.
618618
"""
619619
run_config = run_config or RunConfig()
620+
# Some native audio models requires the modality to be set. So we set it to
621+
# AUDIO by default.
622+
if run_config.response_modalities is None:
623+
run_config.response_modalities = ['AUDIO']
620624
if session is None and (user_id is None or session_id is None):
621625
raise ValueError(
622626
'Either session or user_id and session_id must be provided.'

0 commit comments

Comments
 (0)