chore: provide a way to disable model check for builtin tools

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 872503435
This commit is contained in:
George Weale
2026-02-19 12:02:27 -08:00
committed by Copybara-Service
parent f27a9cfb87
commit eaf50ce37e
16 changed files with 285 additions and 11 deletions
@@ -268,6 +268,27 @@ class TestGoogleSearchTool:
tool_context=tool_context, llm_request=llm_request
)
@pytest.mark.asyncio
async def test_process_llm_request_with_non_gemini_model_and_disabled_check(
self, monkeypatch
):
"""Test non-Gemini model can pass when model-id check is disabled."""
monkeypatch.setenv('ADK_DISABLE_GEMINI_MODEL_ID_CHECK', 'true')
tool = GoogleSearchTool()
tool_context = await _create_tool_context()
llm_request = LlmRequest(
model='internal-model-v1', config=types.GenerateContentConfig()
)
await tool.process_llm_request(
tool_context=tool_context, llm_request=llm_request
)
assert llm_request.config.tools is not None
assert len(llm_request.config.tools) == 1
assert llm_request.config.tools[0].google_search is not None
@pytest.mark.asyncio
async def test_process_llm_request_with_path_based_non_gemini_model_raises_error(
self,