Skip to content

Commit 09dde8c

Browse files
committed
Lazy-import Google exception
1 parent 5b3b631 commit 09dde8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

redisvl/utils/vectorize/vertexai.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
from functools import cached_property
33
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
44

5-
from google.api_core.exceptions import InvalidArgument
65
from pydantic import ConfigDict
76
from tenacity import retry, stop_after_attempt, wait_random_exponential
87
from tenacity.retry import retry_if_not_exception_type
98

9+
from redisvl.utils.utils import lazy_import
10+
1011
if TYPE_CHECKING:
1112
from redisvl.extensions.cache.embeddings.embeddings import EmbeddingsCache
1213

1314
from redisvl.utils.vectorize.base import BaseVectorizer
1415

16+
InvalidArgument = lazy_import("google.api_core.exceptions.InvalidArgument")
17+
1518

1619
class VertexAIVectorizer(BaseVectorizer):
1720
"""The VertexAIVectorizer uses Google's VertexAI embedding model

0 commit comments

Comments
 (0)