From 2ef5a41a24b7f0ff83a467b834d747ce3baba1d1 Mon Sep 17 00:00:00 2001 From: AlexsanderHamir Date: Tue, 25 Nov 2025 12:48:24 -0800 Subject: [PATCH] fix: resolve type checking errors in vertex_ai and mcp_server_manager - Fix type incompatibility in vertex_ai/videos/transformation.py by casting litellm_params to Dict[str, Any] - Add await to async add_update_server call in mcp_server_manager.py - Resolves 4 type checking errors across 2 files --- litellm/llms/vertex_ai/videos/transformation.py | 9 +++++---- .../proxy/_experimental/mcp_server/mcp_server_manager.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/litellm/llms/vertex_ai/videos/transformation.py b/litellm/llms/vertex_ai/videos/transformation.py index 2b6d43dd708..1f657f63bf1 100644 --- a/litellm/llms/vertex_ai/videos/transformation.py +++ b/litellm/llms/vertex_ai/videos/transformation.py @@ -7,7 +7,7 @@ Based on: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/model-refer import base64 import time -from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union +from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union, cast import httpx from httpx._types import RequestFiles @@ -174,10 +174,11 @@ class VertexAIVideoConfig(BaseVideoConfig, VertexBase): """ # Extract Vertex AI parameters using safe helpers from VertexBase # Use safe_get_* methods that don't mutate litellm_params dict - litellm_params = litellm_params or {} + # Ensure litellm_params is a dict for type checking + params_dict: Dict[str, Any] = cast(Dict[str, Any], litellm_params) if litellm_params is not None else {} - vertex_project = VertexBase.safe_get_vertex_ai_project(litellm_params=litellm_params) - vertex_credentials = VertexBase.safe_get_vertex_ai_credentials(litellm_params=litellm_params) + vertex_project = VertexBase.safe_get_vertex_ai_project(litellm_params=params_dict) + vertex_credentials = VertexBase.safe_get_vertex_ai_credentials(litellm_params=params_dict) # Get access token from Vertex credentials access_token, project_id = self.get_access_token( diff --git a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py index 54c79fc696c..4a0d25e24f3 100644 --- a/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py +++ b/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py @@ -2270,7 +2270,7 @@ class MCPServerManager: server.status = "unhealthy" ## try adding server to registry to get error try: - self.add_update_server(server) + await self.add_update_server(server) except Exception as e: server.health_check_error = str(e) server.health_check_error = "Server is not in in memory registry yet. This could be a temporary sync issue."