mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05: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(
|
model_group.add_argument(
|
||||||
"--require-model-info",
|
"--show-model-warnings",
|
||||||
action=argparse.BooleanOptionalAction,
|
action=argparse.BooleanOptionalAction,
|
||||||
default=False,
|
default=True,
|
||||||
help="Only work with models that have meta-data available (default: True)",
|
help="Only work with models that have meta-data available (default: True)",
|
||||||
)
|
)
|
||||||
model_group.add_argument(
|
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)
|
main_model = models.Model(args.model, weak_model=args.weak_model)
|
||||||
|
|
||||||
missing_model_info = models.sanity_check_models(io, main_model)
|
if args.show_model_warnings:
|
||||||
if args.require_model_info and missing_model_info:
|
models.sanity_check_models(io, main_model)
|
||||||
return 1
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
coder = Coder.create(
|
coder = Coder.create(
|
||||||
|
|
|
@ -309,7 +309,7 @@ class Model:
|
||||||
if res["missing_keys"]:
|
if res["missing_keys"]:
|
||||||
return res
|
return res
|
||||||
|
|
||||||
provider = self.info.get("litellm_provider").lower()
|
provider = self.info.get("litellm_provider", "").lower()
|
||||||
if provider == "cohere_chat":
|
if provider == "cohere_chat":
|
||||||
return validate_variables(["COHERE_API_KEY"])
|
return validate_variables(["COHERE_API_KEY"])
|
||||||
if provider == "gemini":
|
if provider == "gemini":
|
||||||
|
@ -331,13 +331,9 @@ def validate_variables(vars):
|
||||||
|
|
||||||
|
|
||||||
def sanity_check_models(io, main_model):
|
def sanity_check_models(io, main_model):
|
||||||
missing_model_info = False
|
sanity_check_model(io, main_model)
|
||||||
if not sanity_check_model(io, main_model):
|
|
||||||
missing_model_info = True
|
|
||||||
if main_model.weak_model and main_model.weak_model is not 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):
|
sanity_check_model(io, main_model.weak_model)
|
||||||
missing_model_info = True
|
|
||||||
return missing_model_info
|
|
||||||
|
|
||||||
|
|
||||||
def sanity_check_model(io, model):
|
def sanity_check_model(io, model):
|
||||||
|
@ -371,8 +367,6 @@ def sanity_check_model(io, model):
|
||||||
if show:
|
if show:
|
||||||
io.tool_error("For more info see https://aider.chat/docs/llms.html#model-warnings")
|
io.tool_error("For more info see https://aider.chat/docs/llms.html#model-warnings")
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
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