mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 04:35:00 +00:00
Added --require-model-info
This commit is contained in:
parent
aac110f078
commit
f81b62dfea
4 changed files with 36 additions and 10 deletions
|
@ -197,7 +197,10 @@ class Commands:
|
|||
self.io.tool_output("=" * (width + cost_width + 1))
|
||||
self.io.tool_output(f"${total_cost:7.4f} {fmt(total)} tokens total")
|
||||
|
||||
limit = self.coder.main_model.info.get("max_input_tokens")
|
||||
limit = self.coder.main_model.info.get("max_input_tokens", 0)
|
||||
if not limit:
|
||||
return
|
||||
|
||||
remaining = limit - total
|
||||
if remaining > 1024:
|
||||
self.io.tool_output(f"{cost_pad}{fmt(remaining)} tokens remaining in context window")
|
||||
|
@ -207,7 +210,10 @@ class Commands:
|
|||
" /clear to make space)"
|
||||
)
|
||||
else:
|
||||
self.io.tool_error(f"{cost_pad}{fmt(remaining)} tokens remaining, window exhausted!")
|
||||
self.io.tool_error(
|
||||
f"{cost_pad}{fmt(remaining)} tokens remaining, window exhausted (use /drop or"
|
||||
" /clear to make space)"
|
||||
)
|
||||
self.io.tool_output(f"{cost_pad}{fmt(limit)} tokens max context window size")
|
||||
|
||||
def cmd_undo(self, args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue