Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

supports_web_search

Ishaan Jaffc4cbfd57162c
diff --git a/litellm/utils.py b/litellm/utils.py
index 52dbccb0c82..03e69acf4e3 100644
--- a/litellm/utils.py
+++ b/litellm/utils.py
@@ -1975,6 +1975,27 @@ def supports_system_messages(model: str, custom_llm_provider: Optional[str]) ->
)
+def supports_web_search(model: str, custom_llm_provider: Optional[str]) -> bool:
+ """
+ Check if the given model supports web search and return a boolean value.
+
+ Parameters:
+ model (str): The model name to be checked.
+ custom_llm_provider (str): The provider to be checked.
+
+ Returns:
+ bool: True if the model supports web search, False otherwise.
+
+ Raises:
+ Exception: If the given model is not found in model_prices_and_context_window.json.
+ """
+ return _supports_factory(
+ model=model,
+ custom_llm_provider=custom_llm_provider,
+ key="supports_web_search",
+ )
+
+
def supports_native_streaming(model: str, custom_llm_provider: Optional[str]) -> bool:
"""
Check if the given model supports native streaming and return a boolean value.