diff --git a/src/google/adk/evaluation/app_details.py b/src/google/adk/evaluation/app_details.py index 7de5ccf2..85473f85 100644 --- a/src/google/adk/evaluation/app_details.py +++ b/src/google/adk/evaluation/app_details.py @@ -14,6 +14,8 @@ from __future__ import annotations +from typing import Any + from google.genai import types as genai_types from pydantic import Field @@ -32,8 +34,12 @@ class AgentDetails(EvalBaseModel): instructions: str = Field(default="") """The instructions set on the Agent.""" - tool_declarations: genai_types.ToolListUnion = Field(default_factory=list) - """A list of tools available to the Agent.""" + tool_declarations: list[Any] = Field(default_factory=list) + """A list of tools available to the Agent. + + At runtime, this contains elements of type genai_types.ToolListUnion. + We use list[Any] for Pydantic schema generation compatibility. + """ class AppDetails(EvalBaseModel): diff --git a/src/google/adk/evaluation/llm_as_judge_utils.py b/src/google/adk/evaluation/llm_as_judge_utils.py index 3d6fd923..cf1309ca 100644 --- a/src/google/adk/evaluation/llm_as_judge_utils.py +++ b/src/google/adk/evaluation/llm_as_judge_utils.py @@ -16,6 +16,7 @@ from __future__ import annotations import enum import statistics +from typing import Any from typing import Optional from typing import Union @@ -78,7 +79,7 @@ def get_average_rubric_score( class _ToolDeclarations(EvalBaseModel): """Internal data model used for serializing Tool declarations.""" - tool_declarations: dict[str, genai_types.ToolListUnion] + tool_declarations: dict[str, list[Any]] def get_tool_declarations_as_json_str(