VertexAiSearchTool() call not visible in exectution #2786
Replies: 2 comments 1 reply
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The behavior you're observing with Hello @petrupetru, Thank you for your detailed question. Here is some information based on the ADK documentation that might help clarify the situation. Naming of
|
Beta Was this translation helpful? Give feedback.
-
There is a bug that neither |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have one LlmAgent() with multiple VertexAiSearchTool() tools. The problem is that nowhere in akd web, or even in the response events i can find the tools call. In adk web it looks like i have only one tool named "vertex_ai_search", and tool callbacks are not triggered by the seach. The agent works, I get grounded responses, but i want to see somewhere the execution and also give names to my search tools so i can reference them in the prompt.
In adk web UI i only get 1 event per query, so it shows only one tool and no calls to it
Agent:
root_agent = LlmAgent( name="menu_agent", model=MODEL, description=( "This agent ..." ), instruction=prompt, output_key="menu_output", tools=[ 1_tool, 2_tool, 3_tool, 4_tool, ], after_tool_callback=simple_after_tool_modifier, )
Tool example:
1_tool= VertexAiSearchTool( search_engine_id=f"projects/{PROJECT_ID}/locations/{LOCATION}/collections/default_collection/engines/{ENGINE_ID}" )
Tool callback:
def simple_after_tool_modifier( tool: BaseTool, args: Dict[str, Any], tool_context: ToolContext, tool_response: Dict ) -> Optional[Dict]: """Inspects/modifies the tool result after execution.""" agent_name = tool_context.agent_name tool_name = tool.name print(f"[Callback] After tool call for tool '{tool_name}' in agent '{agent_name}'") print(f"[Callback] Args used: {args}") print(f"[Callback] Original tool_response: {tool_response}") return None
Beta Was this translation helpful? Give feedback.
All reactions