mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
Added --show-model-warnings
This commit is contained in:
parent
01cf038bb5
commit
f9e122b9d7
2 changed files with 7 additions and 14 deletions
|
@ -280,9 +280,9 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
),
|
||||
)
|
||||
model_group.add_argument(
|
||||
"--require-model-info",
|
||||
"--show-model-warnings",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=False,
|
||||
default=True,
|
||||
help="Only work with models that have meta-data available (default: True)",
|
||||
)
|
||||
model_group.add_argument(
|
||||
|
@ -623,9 +623,8 @@ def main(argv=None, input=None, output=None, force_git_root=None):
|
|||
|
||||
main_model = models.Model(args.model, weak_model=args.weak_model)
|
||||
|
||||
missing_model_info = models.sanity_check_models(io, main_model)
|
||||
if args.require_model_info and missing_model_info:
|
||||
return 1
|
||||
if args.show_model_warnings:
|
||||
models.sanity_check_models(io, main_model)
|
||||
|
||||
try:
|
||||
coder = Coder.create(
|
||||
|
|
|
@ -309,7 +309,7 @@ class Model:
|
|||
if res["missing_keys"]:
|
||||
return res
|
||||
|
||||
provider = self.info.get("litellm_provider").lower()
|
||||
provider = self.info.get("litellm_provider", "").lower()
|
||||
if provider == "cohere_chat":
|
||||
return validate_variables(["COHERE_API_KEY"])
|
||||
if provider == "gemini":
|
||||
|
@ -331,13 +331,9 @@ def validate_variables(vars):
|
|||
|
||||
|
||||
def sanity_check_models(io, main_model):
|
||||
missing_model_info = False
|
||||
if not sanity_check_model(io, main_model):
|
||||
missing_model_info = True
|
||||
sanity_check_model(io, main_model)
|
||||
if main_model.weak_model and main_model.weak_model is not main_model:
|
||||
if not sanity_check_model(io, main_model.weak_model):
|
||||
missing_model_info = True
|
||||
return missing_model_info
|
||||
sanity_check_model(io, main_model.weak_model)
|
||||
|
||||
|
||||
def sanity_check_model(io, model):
|
||||
|
@ -371,8 +367,6 @@ def sanity_check_model(io, model):
|
|||
if show:
|
||||
io.tool_error("For more info see https://aider.chat/docs/llms.html#model-warnings")
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def fuzzy_match_models(name):
|
||||
name = name.lower()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue