mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
/tokens should warn when <1k tokens left
This commit is contained in:
parent
b849d16ec7
commit
3e77df7587
1 changed files with 6 additions and 1 deletions
|
@ -152,8 +152,13 @@ class Commands:
|
|||
|
||||
limit = self.coder.main_model.max_context_tokens
|
||||
remaining = limit - total
|
||||
if remaining > 0:
|
||||
if remaining > 1024:
|
||||
self.io.tool_output(f"{fmt(remaining)} tokens remaining in context window")
|
||||
elif remaining > 0:
|
||||
self.io.tool_error(
|
||||
f"{fmt(remaining)} tokens remaining in context window (use /drop or /clear to make"
|
||||
" space)"
|
||||
)
|
||||
else:
|
||||
self.io.tool_error(f"{fmt(remaining)} tokens remaining, window exhausted!")
|
||||
self.io.tool_output(f"{fmt(limit)} tokens max context window size")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue