From f508a998d4b34148a3815b229fc0ae272a579ae5 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 31 Jan 2026 11:19:59 -0800 Subject: [PATCH] fix linting --- .../litellm_responses_transformation/transformation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/completion_extras/litellm_responses_transformation/transformation.py b/litellm/completion_extras/litellm_responses_transformation/transformation.py index 8e49c90a595..44006f79fe3 100644 --- a/litellm/completion_extras/litellm_responses_transformation/transformation.py +++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py @@ -17,7 +17,7 @@ from typing import ( Optional, Tuple, Union, - cast + cast, ) from openai.types.responses.tool_param import FunctionToolParam @@ -748,7 +748,9 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge): if isinstance(web_search_options, dict): web_search_tool.update(web_search_options) - responses_api_request["tools"].append(web_search_tool) + # After the check above, tools is guaranteed to be a list + # Cast to Any to match the expected union type for tools list items + responses_api_request["tools"].append(cast(Any, web_search_tool)) def _transform_response_format_to_text_format( self, response_format: Union[Dict[str, Any], Any]