mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix(websearch): avoid mutable key check
This commit is contained in:
parent
a622324182
commit
af0e0f478a
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue