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
This commit is contained in:
AlexsanderHamir 2025-11-25 12:48:24 -08:00
parent 7f991fe897
commit 2ef5a41a24
2 changed files with 6 additions and 5 deletions

View file

@ -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(

View file

@ -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."