refactor: Simplify model dependency checks with new check_for_dependencies function

This commit is contained in:
Paul Gauthier (aider) 2025-03-05 17:06:33 -08:00
parent 6ca6bf7457
commit 74e60e98b7

View file

@ -770,24 +770,8 @@ def sanity_check_model(io, model):
show = True show = True
io.tool_warning(f"Warning for {model}: Unknown which environment variables are required.") io.tool_warning(f"Warning for {model}: Unknown which environment variables are required.")
# Check if this is a Bedrock model and ensure boto3 is installed # Check for model-specific dependencies
if model.name.startswith("bedrock/"): check_for_dependencies(io, model.name)
from aider.utils import check_pip_install_extra
check_pip_install_extra(
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: if not model.info:
show = True show = True