diff --git a/litellm/main.py b/litellm/main.py index e91dcaaf832..fa123c8091e 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -1571,15 +1571,14 @@ def completion( # type: ignore # noqa: PLR0915 # If the model will be bridged to the Responses API, allow params # that the bridge can handle (e.g. web_search_options) even if the # provider's chat/completions config doesn't list them. - if responses_api_model_info.get("mode") == "responses": - _bridge_params = [] - if web_search_options is not None: - _bridge_params.append("web_search_options") - if _bridge_params: - existing = optional_param_args.get("allowed_openai_params") or [] - optional_param_args["allowed_openai_params"] = list( - set(existing + _bridge_params) - ) + if ( + responses_api_model_info.get("mode") == "responses" + and web_search_options is not None + ): + existing = optional_param_args.get("allowed_openai_params") or [] + optional_param_args["allowed_openai_params"] = list( + set(existing + ["web_search_options"]) + ) optional_params = get_optional_params( **optional_param_args, **non_default_params diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 26f41200d4e..7137b1adcdd 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -151,7 +151,7 @@ class ProviderSpecificModelInfo(TypedDict, total=False): bedrock_output_config_effort_ceiling: Optional[ Literal["low", "medium", "high", "max", "xhigh"] ] - supported_endpoints: Optional[list] + supported_endpoints: Optional[List[str]] class SearchContextCostPerQuery(TypedDict, total=False):