mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
refactor: Extract model-specific dependency checks into dedicated function
This commit is contained in:
parent
ea49cdeb17
commit
6ca6bf7457
1 changed files with 26 additions and 0 deletions
|
@ -804,6 +804,32 @@ def sanity_check_model(io, model):
|
||||||
return show
|
return show
|
||||||
|
|
||||||
|
|
||||||
|
def check_for_dependencies(io, model_name):
|
||||||
|
"""
|
||||||
|
Check for model-specific dependencies and install them if needed.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
io: The IO object for user interaction
|
||||||
|
model_name: The name of the model to check dependencies for
|
||||||
|
"""
|
||||||
|
from aider.utils import check_pip_install_extra
|
||||||
|
|
||||||
|
# Check if this is a Bedrock model and ensure boto3 is installed
|
||||||
|
if model_name.startswith("bedrock/"):
|
||||||
|
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
|
||||||
|
elif model_name.startswith("vertex_ai/"):
|
||||||
|
check_pip_install_extra(
|
||||||
|
io,
|
||||||
|
"google.cloud.aiplatform",
|
||||||
|
"Google Vertex AI models require the google-cloud-aiplatform package.",
|
||||||
|
["google-cloud-aiplatform"]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def fuzzy_match_models(name):
|
def fuzzy_match_models(name):
|
||||||
name = name.lower()
|
name = name.lower()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue