mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
chore: Avoid mutable default arguments in local_eval_service and runners
Changed default values for `session_service`, `artifact_service`, and `run_config` from instances of mutable classes to `None`. Instances are now created within the function body if the argument is not provided, preventing unexpected shared state across function calls. PiperOrigin-RevId: 804624564
This commit is contained in:
committed by
Copybara-Service
parent
d56dd08072
commit
64f11a6a67
@@ -21,7 +21,6 @@ import sys
|
||||
import tempfile
|
||||
import time
|
||||
from typing import Any
|
||||
from typing import Optional
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import patch
|
||||
|
||||
@@ -121,9 +120,8 @@ async def dummy_run_async(
|
||||
session_id,
|
||||
new_message,
|
||||
state_delta=None,
|
||||
run_config: Optional[RunConfig] = None,
|
||||
run_config: RunConfig = RunConfig(),
|
||||
):
|
||||
run_config = run_config or RunConfig()
|
||||
yield _event_1()
|
||||
await asyncio.sleep(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user