File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1919
2020from google .genai import types
2121from pydantic import BaseModel
22+ from pydantic import ConfigDict
2223from pydantic import model_validator
2324from typing_extensions import override
2425
2728from ..memory .in_memory_memory_service import InMemoryMemoryService
2829from ._forwarding_artifact_service import ForwardingArtifactService
2930from .base_tool import BaseTool
31+ from .base_tool import BaseToolConfig
3032from .base_tool import ToolArgsConfig
3133from .tool_context import ToolContext
3234
@@ -175,7 +177,7 @@ def from_config(
175177 )
176178
177179
178- class AgentToolConfig (BaseModel ):
180+ class AgentToolConfig (BaseToolConfig ):
179181 """The config for the AgentTool."""
180182
181183 agent : AgentRefConfig
Original file line number Diff line number Diff line change @@ -259,3 +259,10 @@ def my_function(config: ToolArgsConfig) -> BaseTool:
259259
260260 args : Optional [ToolArgsConfig ] = None
261261 """The args for the tool."""
262+
263+
264+ class BaseToolConfig (BaseModel ):
265+ """The base configurations for all the tools."""
266+
267+ model_config = ConfigDict (extra = "forbid" )
268+ """Forbid extra fields."""
You can’t perform that action at this time.
0 commit comments