From 607a5d7d95c1101aed65ce2c3eeb7f890564df0c Mon Sep 17 00:00:00 2001 From: Kristin Cowalcijk Date: Fri, 3 Apr 2026 23:42:11 +0800 Subject: [PATCH] fix: resolve MyPy type errors blocking CI --- litellm/_redis.py | 2 +- .../guardrails/guardrail_hooks/model_armor/model_armor.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/_redis.py b/litellm/_redis.py index 2bf32d71b21..bfa20df6bb8 100644 --- a/litellm/_redis.py +++ b/litellm/_redis.py @@ -118,7 +118,7 @@ def _generate_gcp_iam_access_token(service_account: str) -> str: Access token string for GCP IAM authentication """ try: - from google.cloud import iam_credentials_v1 + from google.cloud import iam_credentials_v1 # type: ignore except ImportError: raise ImportError( "google-cloud-iam is required for GCP IAM Redis authentication. " diff --git a/litellm/proxy/guardrails/guardrail_hooks/model_armor/model_armor.py b/litellm/proxy/guardrails/guardrail_hooks/model_armor/model_armor.py index d00e77daa07..3a1edd60f0f 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/model_armor/model_armor.py +++ b/litellm/proxy/guardrails/guardrail_hooks/model_armor/model_armor.py @@ -2,6 +2,7 @@ from typing import ( TYPE_CHECKING, Any, AsyncGenerator, + Dict, List, Literal, Optional, @@ -757,7 +758,7 @@ class ModelArmorGuardrail(CustomGuardrail, VertexBase): ) error_value = detail.get("error", detail) if isinstance(error_value, dict): - error_obj = dict(error_value) + error_obj: Dict[str, Any] = dict(error_value) else: error_obj = {"message": str(error_value)} error_obj["code"] = str(e.status_code)