Skip to content

Support using enterprise_web_search built-in tool with other tools in the same agent #3412

@m-baden

Description

@m-baden

Is your feature request related to a problem? Please describe.
The enterprise_web_search built-in tool cannot be used simultaneously with other tools within a single LlmAgent.
When an agent is configured with enterprise_web_search alongside other function tools or built-in tools, it causes
integration issues, preventing the agent from functioning correctly. This limits the capabilities of agents that
need to perform enterprise searches in combination with other actions.

Describe the solution you'd like
To enable the use of enterprise_web_search with other tools, a workaround has been implemented, consistent with
the existing solution for the google_search tool.

The solution involves:

  1. Introducing EnterpriseSearchAgentTool, a new AgentTool that wraps the enterprise_web_search tool within a
    dedicated, isolated sub-agent.
  2. When an LlmAgent is defined with multiple tools including enterprise_web_search, the framework now automatically
    uses this EnterpriseSearchAgentTool wrapper.
  3. A bypass_multi_tools_limit parameter was added to EnterpriseWebSearchTool to conditionally enable this wrapping
    behavior, ensuring backward compatibility and control.
  4. This approach isolates the enterprise_web_search tool's execution, allowing it to coexist and function correctly
    with other tools in the same agent.

Describe alternatives you've considered
A more fundamental alternative would be to re-architect the core integration of built-in tools within the ADK to
remove the limitation that prevents them from being used with other tools. This would be a more complex and
potentially breaking change. The current solution acts as a targeted and effective workaround that resolves the
immediate problem without requiring a major refactoring.

Additional context
This implementation mirrors the workaround already in place for the google_search tool (see commit
d3148dacc97f0a9a39b6d7a9640f7b7b0d6f9a6c), ensuring a consistent design pattern for handling such built-in tool
limitations.

Metadata

Metadata

Assignees

Labels

tools[Component] This issue is related to tools

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions