From 6f4a3468e6739e3173ab7e14851d5971d8390d9b Mon Sep 17 00:00:00 2001 From: Holt Skinner <13262395+holtskinner@users.noreply.github.com> Date: Thu, 4 Apr 2024 08:35:08 -0500 Subject: [PATCH] fix: Add `blob.reload()` to populate `blob.content_type` (#116) * fix: Add `blob.reload()` to populate `blob.content_type` --- libs/vertexai/langchain_google_vertexai/_image_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/vertexai/langchain_google_vertexai/_image_utils.py b/libs/vertexai/langchain_google_vertexai/_image_utils.py index 47620526..73bcd39f 100644 --- a/libs/vertexai/langchain_google_vertexai/_image_utils.py +++ b/libs/vertexai/langchain_google_vertexai/_image_utils.py @@ -192,7 +192,9 @@ def _blob_from_gcs(self, gcs_uri: str) -> storage.Blob: """ gcs_client = storage.Client(project=self._project) - return storage.Blob.from_string(gcs_uri, gcs_client) + blob = storage.Blob.from_string(gcs_uri, gcs_client) + blob.reload(client=gcs_client) + return blob def _is_url(self, url_string: str) -> bool: """Checks if a url is valid.