mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
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:
committed by
Copybara-Service
parent
f27a9cfb87
commit
eaf50ce37e
@@ -190,6 +190,27 @@ class TestUrlContextTool:
|
||||
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 = UrlContextTool()
|
||||
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].url_context is not None
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_process_llm_request_with_path_based_non_gemini_model_raises_error(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user