feat: Set default for bypass_multi_tools_limit to False for GoogleSearchTool and VertexAiSearchTool

PiperOrigin-RevId: 818053371
This commit is contained in:
Google Team Member
2025-10-11 09:57:36 -07:00
committed by Copybara-Service
parent b21d0a50d6
commit 6da7274858
4 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class GoogleSearchTool(BaseTool):
local code execution.
"""
def __init__(self, *, bypass_multi_tools_limit: bool = True):
def __init__(self, *, bypass_multi_tools_limit: bool = False):
"""Initializes the Google search tool.
Args:
@@ -47,7 +47,7 @@ class VertexAiSearchTool(BaseTool):
search_engine_id: Optional[str] = None,
filter: Optional[str] = None,
max_results: Optional[int] = None,
bypass_multi_tools_limit: bool = True,
bypass_multi_tools_limit: bool = False,
):
"""Initializes the Vertex AI Search tool.
@@ -299,7 +299,7 @@ class TestCanonicalTools:
model='gemini-pro',
tools=[
self._my_tool,
google_search,
GoogleSearchTool(bypass_multi_tools_limit=True),
],
)
ctx = await _create_readonly_context(agent)
@@ -373,7 +373,10 @@ class TestCanonicalTools:
model='gemini-pro',
tools=[
self._my_tool,
VertexAiSearchTool(data_store_id='test_data_store_id'),
VertexAiSearchTool(
data_store_id='test_data_store_id',
bypass_multi_tools_limit=True,
),
],
)
ctx = await _create_readonly_context(agent)
@@ -25,12 +25,14 @@ from google.adk.models.llm_request import LlmRequest
from google.adk.models.llm_response import LlmResponse
from google.adk.plugins.base_plugin import BasePlugin
from google.adk.tools.base_toolset import BaseToolset
from google.adk.tools.google_search_tool import google_search
from google.adk.tools.google_search_tool import GoogleSearchTool
from google.genai import types
import pytest
from ... import testing_utils
google_search = GoogleSearchTool(bypass_multi_tools_limit=True)
class BaseLlmFlowForTesting(BaseLlmFlow):
"""Test implementation of BaseLlmFlow for testing purposes."""