diff --git a/libs/genai/langchain_google_genai/chat_models.py b/libs/genai/langchain_google_genai/chat_models.py index d2a3dbf8..3abe3851 100644 --- a/libs/genai/langchain_google_genai/chat_models.py +++ b/libs/genai/langchain_google_genai/chat_models.py @@ -106,13 +106,13 @@ IMAGE_TYPES: Tuple = () try: - import PIL - from PIL.Image import Image + import PIL # type: ignore + from PIL.Image import Image # type: ignore IMAGE_TYPES = IMAGE_TYPES + (Image,) except ImportError: - PIL = None # type: ignore - Image = None # type: ignore + PIL = None + Image = None logger = logging.getLogger(__name__) @@ -254,7 +254,7 @@ def _is_b64(s: str) -> bool: def _load_image_from_gcs(path: str, project: Optional[str] = None) -> Image: try: - from google.cloud import storage # type: ignore[attr-defined] + from google.cloud import storage except ImportError: raise ImportError( "google-cloud-storage is required to load images from GCS."