You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
fix(config): forbid extra fields in AgentToolConfig
PiperOrigin-RevId: 789038376
This commit is contained in:
committed by
Copybara-Service
parent
6191412b07
commit
d5dcef2cf0
@@ -19,6 +19,7 @@ from typing import TYPE_CHECKING
|
||||
|
||||
from google.genai import types
|
||||
from pydantic import BaseModel
|
||||
from pydantic import ConfigDict
|
||||
from pydantic import model_validator
|
||||
from typing_extensions import override
|
||||
|
||||
@@ -27,6 +28,7 @@ from ..agents.common_configs import AgentRefConfig
|
||||
from ..memory.in_memory_memory_service import InMemoryMemoryService
|
||||
from ._forwarding_artifact_service import ForwardingArtifactService
|
||||
from .base_tool import BaseTool
|
||||
from .base_tool import BaseToolConfig
|
||||
from .base_tool import ToolArgsConfig
|
||||
from .tool_context import ToolContext
|
||||
|
||||
@@ -175,7 +177,7 @@ class AgentTool(BaseTool):
|
||||
)
|
||||
|
||||
|
||||
class AgentToolConfig(BaseModel):
|
||||
class AgentToolConfig(BaseToolConfig):
|
||||
"""The config for the AgentTool."""
|
||||
|
||||
agent: AgentRefConfig
|
||||
|
||||
@@ -259,3 +259,10 @@ class ToolConfig(BaseModel):
|
||||
|
||||
args: Optional[ToolArgsConfig] = None
|
||||
"""The args for the tool."""
|
||||
|
||||
|
||||
class BaseToolConfig(BaseModel):
|
||||
"""The base configurations for all the tools."""
|
||||
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
"""Forbid extra fields."""
|
||||
|
||||
Reference in New Issue
Block a user