From 8a9a271141678996c9b84b8c55d4b539d011391c Mon Sep 17 00:00:00 2001 From: "Wei Sun (Jack)" Date: Fri, 15 Aug 2025 10:12:46 -0700 Subject: [PATCH] fix(config): Fixes SequentialAgent.config_type type hint Without ClassVar, it will cause pydantic to generate warning. PiperOrigin-RevId: 795518646 --- src/google/adk/agents/llm_agent.py | 2 +- src/google/adk/agents/sequential_agent.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/google/adk/agents/llm_agent.py b/src/google/adk/agents/llm_agent.py index 99302e2f..c3b6582d 100644 --- a/src/google/adk/agents/llm_agent.py +++ b/src/google/adk/agents/llm_agent.py @@ -130,7 +130,7 @@ class LlmAgent(BaseAgent): When not set, the agent will inherit the model from its ancestor. """ - config_type: ClassVar[type[BaseAgentConfig]] = LlmAgentConfig + config_type: ClassVar[Type[BaseAgentConfig]] = LlmAgentConfig """The config type for this agent.""" instruction: Union[str, InstructionProvider] = '' diff --git a/src/google/adk/agents/sequential_agent.py b/src/google/adk/agents/sequential_agent.py index 8ec1e43b..3d59452f 100644 --- a/src/google/adk/agents/sequential_agent.py +++ b/src/google/adk/agents/sequential_agent.py @@ -17,6 +17,7 @@ from __future__ import annotations from typing import AsyncGenerator +from typing import ClassVar from typing import Type from typing_extensions import override @@ -33,7 +34,7 @@ from .sequential_agent_config import SequentialAgentConfig class SequentialAgent(BaseAgent): """A shell agent that runs its sub-agents in sequence.""" - config_type: Type[BaseAgentConfig] = SequentialAgentConfig + config_type: ClassVar[Type[BaseAgentConfig]] = SequentialAgentConfig """The config type for this agent.""" @override