Skip to content

Commit 01d76bb

Browse files
committed
fix: Handle App objects in eval and graph endpoints
Fixes #3059 - Extract root_agent from App objects in eval execution endpoint - Extract root_agent from App objects in graph visualization endpoint - Both endpoints now handle BaseAgent and App objects correctly
1 parent cc24d61 commit 01d76bb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/google/adk/cli/adk_web_server.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,14 @@ async def run_eval(
10891089
status_code=400, detail=f"Eval set `{eval_set_id}` not found."
10901090
)
10911091

1092-
root_agent = self.agent_loader.load_agent(app_name)
1092+
agent_or_app = self.agent_loader.load_agent(app_name)
1093+
# The loader may return an App; unwrap to its root agent so the graph builder
1094+
# receives a BaseAgent instance.
1095+
root_agent = (
1096+
agent_or_app.root_agent
1097+
if isinstance(agent_or_app, App)
1098+
else agent_or_app
1099+
)
10931100

10941101
eval_case_results = []
10951102

0 commit comments

Comments
 (0)