mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
fix: Handle missing model info values gracefully
This commit is contained in:
parent
72572f06d9
commit
e48fecee14
3 changed files with 6 additions and 8 deletions
|
@ -852,7 +852,7 @@ class Coder:
|
|||
|
||||
final = messages[-1]
|
||||
|
||||
max_input_tokens = self.main_model.info.get("max_input_tokens")
|
||||
max_input_tokens = self.main_model.info.get("max_input_tokens") or 0
|
||||
# Add the reminder prompt if we still have room to include it.
|
||||
if (
|
||||
max_input_tokens is None
|
||||
|
@ -1011,10 +1011,10 @@ class Coder:
|
|||
output_tokens = 0
|
||||
if self.partial_response_content:
|
||||
output_tokens = self.main_model.token_count(self.partial_response_content)
|
||||
max_output_tokens = self.main_model.info.get("max_output_tokens", 0)
|
||||
max_output_tokens = self.main_model.info.get("max_output_tokens") or 0
|
||||
|
||||
input_tokens = self.main_model.token_count(self.format_messages())
|
||||
max_input_tokens = self.main_model.info.get("max_input_tokens", 0)
|
||||
max_input_tokens = self.main_model.info.get("max_input_tokens") or 0
|
||||
|
||||
total_tokens = input_tokens + output_tokens
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue