From cca1943b6ef65ae4ec13fe32e6fa9161edf2b46e Mon Sep 17 00:00:00 2001 From: Priyansh Nandwana Date: Sat, 10 Oct 2026 11:48:54 +0530 Subject: [PATCH] fix(websearch): type the chat patch builder kwargs instead of working around them --- litellm/integrations/websearch_interception/handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/integrations/websearch_interception/handler.py b/litellm/integrations/websearch_interception/handler.py index cd1f6ba6fe6..3927bb8ecea 100644 --- a/litellm/integrations/websearch_interception/handler.py +++ b/litellm/integrations/websearch_interception/handler.py @@ -1826,7 +1826,7 @@ class WebSearchInterceptionLogger(CustomLogger): messages: list[dict], tool_calls: list[dict], optional_params: dict, - kwargs: dict, + kwargs: dict[str, object], response_format: str = "openai", ) -> AgenticLoopRequestPatch: """Execute litellm.search() and build chat-completion rerun patch.""" @@ -1912,7 +1912,7 @@ class WebSearchInterceptionLogger(CustomLogger): k: v for k, v in kwargs.items() if not k.startswith("_websearch_interception") and k not in internal_params } - custom_llm_provider: Final = kwargs["custom_llm_provider"] if "custom_llm_provider" in kwargs else "" + custom_llm_provider: Final = kwargs.get("custom_llm_provider") full_model_name: Final = qualify_provider_stripped_model( model, custom_llm_provider if isinstance(custom_llm_provider, str) else "" )