mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
refactor: Simplify model dependency checks with new check_for_dependencies function
This commit is contained in:
parent
6ca6bf7457
commit
74e60e98b7
1 changed files with 2 additions and 18 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue