From 1e230e87e3d60fbe5bc7b51504244d68a36c1f3b Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 11 Sep 2025 20:05:29 -0700 Subject: [PATCH] fixes for mypy --- litellm/responses/mcp/mcp_streaming_iterator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/responses/mcp/mcp_streaming_iterator.py b/litellm/responses/mcp/mcp_streaming_iterator.py index b0673880cec..8045d1c1dca 100644 --- a/litellm/responses/mcp/mcp_streaming_iterator.py +++ b/litellm/responses/mcp/mcp_streaming_iterator.py @@ -70,7 +70,8 @@ async def create_mcp_list_tools_events( mcp_tools_dict = [] for tool in filtered_mcp_tools: if hasattr(tool, 'model_dump') and callable(getattr(tool, 'model_dump')): - mcp_tools_dict.append(tool.model_dump()) + # Type cast to help mypy understand this is safe after hasattr check + mcp_tools_dict.append(cast(Any, tool).model_dump()) elif hasattr(tool, '__dict__'): mcp_tools_dict.append(tool.__dict__) else: