You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-03-30 10:57:20 -07:00
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
This commit is contained in:
committed by
Copybara-Service
parent
90e1e3e10c
commit
68402bda49
@@ -617,6 +617,10 @@ class Runner:
|
||||
Either `session` or both `user_id` and `session_id` must be provided.
|
||||
"""
|
||||
run_config = run_config or RunConfig()
|
||||
# Some native audio models requires the modality to be set. So we set it to
|
||||
# AUDIO by default.
|
||||
if run_config.response_modalities is None:
|
||||
run_config.response_modalities = ['AUDIO']
|
||||
if session is None and (user_id is None or session_id is None):
|
||||
raise ValueError(
|
||||
'Either session or user_id and session_id must be provided.'
|
||||
|
||||
Reference in New Issue
Block a user