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

PiperOrigin-RevId: 780692178
This commit is contained in:
Yanfei Chen
2025-07-08 13:28:40 -07:00
committed by Copybara-Service
parent b5d9f8f3e3
commit e33161b4f8
@@ -47,8 +47,8 @@ class EnterpriseWebSearchTool(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(
'Enterprise web search tool can not be used with other tools in'
' Gemini 1.x.'