diff --git a/litellm/integrations/websearch_interception/tools.py b/litellm/integrations/websearch_interception/tools.py index d5c72f6eae6..e5ca0b8ba8f 100644 --- a/litellm/integrations/websearch_interception/tools.py +++ b/litellm/integrations/websearch_interception/tools.py @@ -195,7 +195,7 @@ def is_web_search_tool_chat_completion(tool: dict[str, Any]) -> bool: # The conventional name is only recognized for the name-only shape. # A user-defined function may also be named ``web_search``; preserving # any additional definition fields lets that tool pass through intact. - if function_name == "web_search" and set(function_def) == {"name"}: + if function_name == "web_search" and len(function_def) == 1 and "name" in function_def: return True # Check for LiteLLM standard tool (Anthropic format) @@ -285,7 +285,7 @@ def is_web_search_tool(tool: dict[str, Any]) -> bool: return True # Do not hijack a user-defined function that happens to use the # conventional name and carries its own schema or description. - if function_name == "web_search" and set(function_def) == {"name"}: + if function_name == "web_search" and len(function_def) == 1 and "name" in function_def: return True # Check for LiteLLM standard tool (Anthropic format)