From 98c8a71d670fc92d56ddbae8f71601ec569e07ec Mon Sep 17 00:00:00 2001 From: "Xiang (Sean) Zhou" Date: Sun, 25 May 2025 18:55:41 -0700 Subject: [PATCH] refactor: rename parameter name and add type annotation of _get_agent_to_run method PiperOrigin-RevId: 763234780 --- src/google/adk/flows/llm_flows/base_llm_flow.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/google/adk/flows/llm_flows/base_llm_flow.py b/src/google/adk/flows/llm_flows/base_llm_flow.py index 788f1aa..624273c 100644 --- a/src/google/adk/flows/llm_flows/base_llm_flow.py +++ b/src/google/adk/flows/llm_flows/base_llm_flow.py @@ -472,14 +472,12 @@ class BaseLlmFlow(ABC): yield event def _get_agent_to_run( - self, invocation_context: InvocationContext, transfer_to_agent + self, invocation_context: InvocationContext, agent_name: str ) -> BaseAgent: root_agent = invocation_context.agent.root_agent - agent_to_run = root_agent.find_agent(transfer_to_agent) + agent_to_run = root_agent.find_agent(agent_name) if not agent_to_run: - raise ValueError( - f'Agent {transfer_to_agent} not found in the agent tree.' - ) + raise ValueError(f'Agent {agent_name} not found in the agent tree.') return agent_to_run async def _call_llm_async(