fix: Support project-based gemini model path to use google_search_tool

PiperOrigin-RevId: 770858301
This commit is contained in:
Google Team Member
2025-06-12 17:29:25 -07:00
committed by Copybara-Service
parent 29e4ca9152
commit b2fc7740b3
@@ -76,8 +76,8 @@ class VertexAiSearchTool(BaseTool):
tool_context: ToolContext,
llm_request: LlmRequest,
) -> None:
if llm_request.model and llm_request.model.startswith('gemini-'):
if llm_request.model.startswith('gemini-1') and llm_request.config.tools:
if llm_request.model and 'gemini-' in llm_request.model:
if 'gemini-1' in llm_request.model and llm_request.config.tools:
raise ValueError(
'Vertex AI search tool can not be used with other tools in Gemini'
' 1.x.'