From f9e122b9d7968d8df85ac6fda90d583dd431c89c Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 23 Apr 2024 12:15:37 -0700 Subject: [PATCH] Added --show-model-warnings --- aider/main.py | 9 ++++----- aider/models.py | 12 +++--------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/aider/main.py b/aider/main.py index 712be0d52..ffee5ee6e 100644 --- a/aider/main.py +++ b/aider/main.py @@ -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( diff --git a/aider/models.py b/aider/models.py index f06ec8f0c..59976f2b1 100644 --- a/aider/models.py +++ b/aider/models.py @@ -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()