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:
Hangfei Lin
2025-10-06 17:36:33 -07:00
committed by Copybara-Service
parent 90e1e3e10c
commit 68402bda49
+4
View File
@@ -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.'