mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
fix: Return empty dict if any required parameters are missing
This commit is contained in:
parent
b37773c630
commit
87ccacb99f
1 changed files with 2 additions and 0 deletions
|
@ -258,6 +258,8 @@ class ModelInfoManager:
|
||||||
output_cost_match = re.search(r"\$\s*([\d.]+)\s*/M output tokens", text, re.IGNORECASE)
|
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
|
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
|
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 = {
|
params = {
|
||||||
"max_input_tokens": context_size,
|
"max_input_tokens": context_size,
|
||||||
"max_tokens": context_size,
|
"max_tokens": context_size,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue