mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +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
|
limit = self.coder.main_model.max_context_tokens
|
||||||
remaining = limit - total
|
remaining = limit - total
|
||||||
if remaining > 0:
|
if remaining > 1024:
|
||||||
self.io.tool_output(f"{fmt(remaining)} tokens remaining in context window")
|
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:
|
else:
|
||||||
self.io.tool_error(f"{fmt(remaining)} tokens remaining, window exhausted!")
|
self.io.tool_error(f"{fmt(remaining)} tokens remaining, window exhausted!")
|
||||||
self.io.tool_output(f"{fmt(limit)} tokens max context window size")
|
self.io.tool_output(f"{fmt(limit)} tokens max context window size")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue