mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
Merge pull request #39074 from BerriAI/litellm_fix_websearch_tool_selection_test
test(websearch): register configured search tool in pre-request hook test
This commit is contained in:
commit
caeb5d181e
1 changed files with 11 additions and 0 deletions
|
|
@ -937,6 +937,14 @@ async def test_pre_request_hook_modifies_request_body():
|
|||
|
||||
print("✅ WebSearchInterceptionLogger initialized")
|
||||
|
||||
mock_router = MagicMock()
|
||||
mock_router.search_tools = [
|
||||
{
|
||||
"search_tool_name": "test-search-tool",
|
||||
"litellm_params": {"search_provider": "tavily"},
|
||||
}
|
||||
]
|
||||
|
||||
# Track what actually gets sent to the API
|
||||
captured_request = {}
|
||||
|
||||
|
|
@ -987,6 +995,9 @@ async def test_pre_request_hook_modifies_request_body():
|
|||
with patch(
|
||||
"litellm.llms.anthropic.experimental_pass_through.messages.handler.anthropic_messages_handler",
|
||||
side_effect=mock_anthropic_messages_handler,
|
||||
), patch( # test-quality-ok: the hook imports this process-global router at call time; no injection seam exists to register search_tools
|
||||
"litellm.proxy.proxy_server.llm_router",
|
||||
mock_router,
|
||||
):
|
||||
|
||||
print(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue