mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
fix: shared default plugin manager and cost manager instances among multiple invocations
PiperOrigin-RevId: 791303349
This commit is contained in:
committed by
Copybara-Service
parent
37dae9b631
commit
423542a43f
@@ -20,6 +20,8 @@ import uuid
|
||||
from google.genai import types
|
||||
from pydantic import BaseModel
|
||||
from pydantic import ConfigDict
|
||||
from pydantic import Field
|
||||
from pydantic import PrivateAttr
|
||||
|
||||
from ..artifacts.base_artifact_service import BaseArtifactService
|
||||
from ..auth.credential_service.base_credential_service import BaseCredentialService
|
||||
@@ -154,10 +156,12 @@ class InvocationContext(BaseModel):
|
||||
run_config: Optional[RunConfig] = None
|
||||
"""Configurations for live agents under this invocation."""
|
||||
|
||||
plugin_manager: PluginManager = PluginManager()
|
||||
plugin_manager: PluginManager = Field(default_factory=PluginManager)
|
||||
"""The manager for keeping track of plugins in this invocation."""
|
||||
|
||||
_invocation_cost_manager: _InvocationCostManager = _InvocationCostManager()
|
||||
_invocation_cost_manager: _InvocationCostManager = PrivateAttr(
|
||||
default_factory=_InvocationCostManager
|
||||
)
|
||||
"""A container to keep track of different kinds of costs incurred as a part
|
||||
of this invocation.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user