adk-docs
adk-docs copied to clipboard
We should document how to combine search tools with other tools
Is your feature request related to a problem? Please describe. If you try to use a VertexAISearchTool with other tools, you get an error that search tools cannot be combined with other tools: "Multiple tools are supported only when they are all search tools."
The documentation doesn't describe this, even in Implementation Considerations: https://google.github.io/adk-docs/grounding/vertex_ai_search_grounding/#implementation-considerations
Describe the solution you'd like
We should include this solution that I found in the Google ADK Chat and explain what an AgentTool does to solve this problem: https://chat.google.com/room/AAAAYDpR2kM/TWgBgWeNQbU/wn5KoHWuI8U?cls=10
Maybe that solution should be described in this section: https://google.github.io/adk-docs/tools/built-in-tools/#limitations
@andrewlarimer I cannot open the the Google ADK Chat so that I can solve the problem, can you share it with me please ?
This is a workaround that likely is mentioned in the chat:
vertexai_search_tool = VertexAiSearchTool(
search_engine_id=""
)
vertexai_search_agent = Agent(
name="vertexai_search_agent",
model=os.getenv("MODEL"),
instruction="Use your search tool to look up facts.",
tools=[vertexai_search_tool]
)
root_agent = Agent(
...
tools=[
AgentTool(vertexai_search_agent, skip_summarization=False),
get_date
]
)
See "Using AgentTool to integrate search tools with other tools" section of this tutorial: https://www.cloudskillsboost.google/focuses/125063
It would be nice if the documentation that comes out of this issue also provides a context for this limitation. It's not clear what makes VertexAISearchTool so special that it can't be mixed with other tools.
Also, in recent versions of ADK, if you attempt to create an Agent with both VertexAiSearchTool and a non-search tool, the agent no longer fails. Instead, it behaves rather unexpectedly. For example, if in the lab https://www.cloudskillsboost.google/focuses/125063 in the section "Using AgentTool to integrate search tools with other tools", try to mix tools:
tools=[vertexai_search_tool, get_date]
The agent doesn't return an error; it also doesn't call vertexai_search_tool, but instead it starts calling a discovery_engine_search function that was never even registered as a tool.