From 87ccacb99f79aeab6d3747d3b6c05d55377d9e30 Mon Sep 17 00:00:00 2001 From: "Stefan Hladnik (aider)" Date: Tue, 18 Mar 2025 03:46:36 +0700 Subject: [PATCH] fix: Return empty dict if any required parameters are missing --- aider/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/models.py b/aider/models.py index ed014bb54..749b2c79c 100644 --- a/aider/models.py +++ b/aider/models.py @@ -258,6 +258,8 @@ class ModelInfoManager: output_cost_match = re.search(r"\$\s*([\d.]+)\s*/M output tokens", text, re.IGNORECASE) input_cost = float(input_cost_match.group(1)) / 1000000 if input_cost_match else None output_cost = float(output_cost_match.group(1)) / 1000000 if output_cost_match else None + if context_size is None or input_cost is None or output_cost is None: + return {} params = { "max_input_tokens": context_size, "max_tokens": context_size,