feat: Add Vertex AI model package check for google-cloud-aiplatform

This commit is contained in:
Paul Gauthier (aider) 2025-03-05 16:57:51 -08:00
parent dc02daecee
commit 67b12d4416

View file

@ -778,6 +778,17 @@ def sanity_check_model(io, model):
io, "boto3", "AWS Bedrock models require the boto3 package.", ["boto3"]
)
# Check if this is a Vertex AI model and ensure google-cloud-aiplatform is installed
if model.name.startswith("vertex_ai/"):
from aider.utils import check_pip_install_extra
check_pip_install_extra(
io,
"google.cloud.aiplatform",
"Google Vertex AI models require the google-cloud-aiplatform package.",
["google-cloud-aiplatform"]
)
if not model.info:
show = True
io.tool_warning(