mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
feat: Add assistant reply for token limit exhaustion in base_coder
This commit is contained in:
parent
42ef4352f4
commit
13d24278f2
1 changed files with 10 additions and 2 deletions
|
@ -1326,13 +1326,21 @@ class Coder:
|
||||||
|
|
||||||
self.show_usage_report()
|
self.show_usage_report()
|
||||||
|
|
||||||
|
self.add_assistant_reply_to_cur_messages()
|
||||||
|
|
||||||
if exhausted:
|
if exhausted:
|
||||||
|
if not self.cur_messages or self.cur_messages[-1]["role"] == "user":
|
||||||
|
self.cur_messages += [
|
||||||
|
dict(
|
||||||
|
role="assistant",
|
||||||
|
content="FinishReasonLength exception: you sent too many tokens",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
self.show_exhausted_error()
|
self.show_exhausted_error()
|
||||||
self.num_exhausted_context_windows += 1
|
self.num_exhausted_context_windows += 1
|
||||||
return
|
return
|
||||||
|
|
||||||
self.add_assistant_reply_to_cur_messages()
|
|
||||||
|
|
||||||
if self.partial_response_function_call:
|
if self.partial_response_function_call:
|
||||||
args = self.parse_partial_args()
|
args = self.parse_partial_args()
|
||||||
if args:
|
if args:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue