@@ -188,7 +188,7 @@ def run(
188
188
user_id : str ,
189
189
session_id : str ,
190
190
new_message : types .Content ,
191
- run_config : Optional [ RunConfig ] = None ,
191
+ run_config : RunConfig = RunConfig () ,
192
192
) -> Generator [Event , None , None ]:
193
193
"""Runs the agent.
194
194
@@ -205,7 +205,6 @@ def run(
205
205
Yields:
206
206
The events generated by the agent.
207
207
"""
208
- run_config = run_config or RunConfig ()
209
208
event_queue = queue .Queue ()
210
209
211
210
async def _invoke_run_async ():
@@ -249,7 +248,7 @@ async def run_async(
249
248
session_id : str ,
250
249
new_message : types .Content ,
251
250
state_delta : Optional [dict [str , Any ]] = None ,
252
- run_config : Optional [ RunConfig ] = None ,
251
+ run_config : RunConfig = RunConfig () ,
253
252
) -> AsyncGenerator [Event , None ]:
254
253
"""Main entry method to run the agent in this runner.
255
254
@@ -262,7 +261,6 @@ async def run_async(
262
261
Yields:
263
262
The events generated by the agent.
264
263
"""
265
- run_config = run_config or RunConfig ()
266
264
267
265
async def _run_with_trace (
268
266
new_message : types .Content ,
@@ -428,7 +426,7 @@ async def run_live(
428
426
user_id : Optional [str ] = None ,
429
427
session_id : Optional [str ] = None ,
430
428
live_request_queue : LiveRequestQueue ,
431
- run_config : Optional [ RunConfig ] = None ,
429
+ run_config : RunConfig = RunConfig () ,
432
430
session : Optional [Session ] = None ,
433
431
) -> AsyncGenerator [Event , None ]:
434
432
"""Runs the agent in live mode (experimental feature).
@@ -454,7 +452,6 @@ async def run_live(
454
452
.. NOTE::
455
453
Either `session` or both `user_id` and `session_id` must be provided.
456
454
"""
457
- run_config = run_config or RunConfig ()
458
455
if session is None and (user_id is None or session_id is None ):
459
456
raise ValueError (
460
457
'Either session or user_id and session_id must be provided.'
@@ -604,7 +601,7 @@ def _new_invocation_context(
604
601
* ,
605
602
new_message : Optional [types .Content ] = None ,
606
603
live_request_queue : Optional [LiveRequestQueue ] = None ,
607
- run_config : Optional [ RunConfig ] = None ,
604
+ run_config : RunConfig = RunConfig () ,
608
605
) -> InvocationContext :
609
606
"""Creates a new invocation context.
610
607
@@ -617,7 +614,6 @@ def _new_invocation_context(
617
614
Returns:
618
615
The new invocation context.
619
616
"""
620
- run_config = run_config or RunConfig ()
621
617
invocation_id = new_invocation_context_id ()
622
618
623
619
if run_config .support_cfc and isinstance (self .agent , LlmAgent ):
@@ -649,10 +645,9 @@ def _new_invocation_context_for_live(
649
645
session : Session ,
650
646
* ,
651
647
live_request_queue : Optional [LiveRequestQueue ] = None ,
652
- run_config : Optional [ RunConfig ] = None ,
648
+ run_config : RunConfig = RunConfig () ,
653
649
) -> InvocationContext :
654
650
"""Creates a new invocation context for live multi-agent."""
655
- run_config = run_config or RunConfig ()
656
651
657
652
# For live multi-agent, we need model's text transcription as context for
658
653
# next agent.
0 commit comments