warn when blocked_domains is dropped during web_search translation

This commit is contained in:
Vigilans 2026-04-20 16:55:08 +08:00
parent bb340ce683
commit 86b7d293c5

View file

@ -8,6 +8,7 @@ path used for OpenAI and Azure models.
import json
from typing import Any, Dict, List, Optional, Union, cast
from litellm._logging import verbose_logger
from litellm.litellm_core_utils.reasoning_effort_utils import (
reasoning_effort_from_thinking_budget,
)
@ -189,6 +190,11 @@ class LiteLLMAnthropicToResponsesAPIAdapter:
allowed = tool_dict.get("allowed_domains")
if allowed:
web_tool["filters"] = {"allowed_domains": allowed}
if tool_dict.get("blocked_domains"):
verbose_logger.warning(
"Responses API does not support 'blocked_domains' on web_search tools; "
"this field will be ignored."
)
result.append(web_tool)
continue
func_tool: Dict[str, Any] = {"type": "function", "name": tool_name}