Skip to content

Commit 6da7274

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: Set default for bypass_multi_tools_limit to False for GoogleSearchTool and VertexAiSearchTool
PiperOrigin-RevId: 818053371
1 parent b21d0a5 commit 6da7274

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/google/adk/tools/google_search_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class GoogleSearchTool(BaseTool):
3535
local code execution.
3636
"""
3737

38-
def __init__(self, *, bypass_multi_tools_limit: bool = True):
38+
def __init__(self, *, bypass_multi_tools_limit: bool = False):
3939
"""Initializes the Google search tool.
4040
4141
Args:

src/google/adk/tools/vertex_ai_search_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747
search_engine_id: Optional[str] = None,
4848
filter: Optional[str] = None,
4949
max_results: Optional[int] = None,
50-
bypass_multi_tools_limit: bool = True,
50+
bypass_multi_tools_limit: bool = False,
5151
):
5252
"""Initializes the Vertex AI Search tool.
5353

tests/unittests/agents/test_llm_agent_fields.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ async def test_handle_google_search_with_other_tools(self):
299299
model='gemini-pro',
300300
tools=[
301301
self._my_tool,
302-
google_search,
302+
GoogleSearchTool(bypass_multi_tools_limit=True),
303303
],
304304
)
305305
ctx = await _create_readonly_context(agent)
@@ -373,7 +373,10 @@ async def test_handle_vais_with_other_tools(self):
373373
model='gemini-pro',
374374
tools=[
375375
self._my_tool,
376-
VertexAiSearchTool(data_store_id='test_data_store_id'),
376+
VertexAiSearchTool(
377+
data_store_id='test_data_store_id',
378+
bypass_multi_tools_limit=True,
379+
),
377380
],
378381
)
379382
ctx = await _create_readonly_context(agent)

tests/unittests/flows/llm_flows/test_base_llm_flow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
from google.adk.models.llm_response import LlmResponse
2626
from google.adk.plugins.base_plugin import BasePlugin
2727
from google.adk.tools.base_toolset import BaseToolset
28-
from google.adk.tools.google_search_tool import google_search
28+
from google.adk.tools.google_search_tool import GoogleSearchTool
2929
from google.genai import types
3030
import pytest
3131

3232
from ... import testing_utils
3333

34+
google_search = GoogleSearchTool(bypass_multi_tools_limit=True)
35+
3436

3537
class BaseLlmFlowForTesting(BaseLlmFlow):
3638
"""Test implementation of BaseLlmFlow for testing purposes."""

0 commit comments

Comments
 (0)