diff --git a/ai/providers/vertexai.py b/ai/providers/vertexai.py index 7cfe129..effe0a3 100644 --- a/ai/providers/vertexai.py +++ b/ai/providers/vertexai.py @@ -61,7 +61,11 @@ class VertexAPI(BaseAPIProvider): def __init__(self): self.enabled = bool(os.environ.get("VERTEX_AI_PROJECT_ID", "")) - vertexai.init(project=os.environ.get("VERTEX_AI_PROJECT_ID"), location=os.environ.get("VERTEX_AI_LOCATION")) + if self.enabled: + vertexai.init( + project=os.environ.get("VERTEX_AI_PROJECT_ID"), + location=os.environ.get("VERTEX_AI_LOCATION"), + ) def set_model(self, model_name: str): if model_name not in self.MODELS.keys():