mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
With websearch_interception enabled, the Anthropic-native web_search tool's allowed_domains / blocked_domains were silently dropped: the tool is replaced by the standard LiteLLM web search tool (which has no domain fields) and _execute_search() called litellm.asearch() without search_domain_filter. A /v1/messages request that limited the search to one domain got results from every domain (issue #44188). - Pre-call hooks now stash the domain limits on the request kwargs before the native tool is replaced (same side-channel pattern as the native-blocks flag), and the short-circuit path applies them the same way. - _execute_search() forwards them to litellm.asearch() as search_domain_filter: allowed_domains pass through as an allowlist and blocked_domains as '-'-prefixed exclusions, the convention litellm.asearch's providers (e.g. Perplexity) use. - _AsearchNamedParams now permits search_domain_filter. - New unit tests cover extraction, hook stashing, and the asearch call wiring. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_websearch_agentic_loop_cap.py | ||
| test_websearch_chat_completion.py | ||
| test_websearch_domain_filters.py | ||
| test_websearch_interception_handler.py | ||
| test_websearch_interception_thinking.py | ||
| test_websearch_native_blocks.py | ||
| test_websearch_responses.py | ||
| test_websearch_rich_query_shape.py | ||
| test_websearch_short_circuit.py | ||
| test_websearch_streaming_wrap.py | ||
| test_websearch_thinking_constraint.py | ||