mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
emit the blank line before usage report
This commit is contained in:
parent
4f30db4f51
commit
bfc0123a2f
1 changed files with 11 additions and 6 deletions
|
@ -124,7 +124,7 @@ class Coder:
|
||||||
kwargs = use_kwargs
|
kwargs = use_kwargs
|
||||||
|
|
||||||
for coder in coders.__all__:
|
for coder in coders.__all__:
|
||||||
if hasattr(coder, 'edit_format') and coder.edit_format == edit_format:
|
if hasattr(coder, "edit_format") and coder.edit_format == edit_format:
|
||||||
res = coder(main_model, io, **kwargs)
|
res = coder(main_model, io, **kwargs)
|
||||||
res.original_kwargs = dict(kwargs)
|
res.original_kwargs = dict(kwargs)
|
||||||
return res
|
return res
|
||||||
|
@ -790,10 +790,11 @@ class Coder:
|
||||||
messages += self.done_messages
|
messages += self.done_messages
|
||||||
messages += self.get_files_messages()
|
messages += self.get_files_messages()
|
||||||
|
|
||||||
|
|
||||||
if self.gpt_prompts.system_reminder:
|
if self.gpt_prompts.system_reminder:
|
||||||
reminder_message = [
|
reminder_message = [
|
||||||
dict(role="system", content=self.fmt_system_prompt(self.gpt_prompts.system_reminder)),
|
dict(
|
||||||
|
role="system", content=self.fmt_system_prompt(self.gpt_prompts.system_reminder)
|
||||||
|
),
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
reminder_message = []
|
reminder_message = []
|
||||||
|
@ -815,7 +816,11 @@ class Coder:
|
||||||
|
|
||||||
max_input_tokens = self.main_model.info.get("max_input_tokens")
|
max_input_tokens = self.main_model.info.get("max_input_tokens")
|
||||||
# Add the reminder prompt if we still have room to include it.
|
# Add the reminder prompt if we still have room to include it.
|
||||||
if max_input_tokens is None or total_tokens < max_input_tokens and self.gpt_prompts.system_reminder:
|
if (
|
||||||
|
max_input_tokens is None
|
||||||
|
or total_tokens < max_input_tokens
|
||||||
|
and self.gpt_prompts.system_reminder
|
||||||
|
):
|
||||||
if self.main_model.reminder_as_sys_msg:
|
if self.main_model.reminder_as_sys_msg:
|
||||||
messages += reminder_message
|
messages += reminder_message
|
||||||
elif final["role"] == "user":
|
elif final["role"] == "user":
|
||||||
|
@ -890,6 +895,8 @@ class Coder:
|
||||||
self.partial_response_content = self.get_multi_response_content(True)
|
self.partial_response_content = self.get_multi_response_content(True)
|
||||||
self.multi_response_content = ""
|
self.multi_response_content = ""
|
||||||
|
|
||||||
|
self.io.tool_output()
|
||||||
|
|
||||||
if self.usage_report:
|
if self.usage_report:
|
||||||
self.io.tool_output(self.usage_report)
|
self.io.tool_output(self.usage_report)
|
||||||
|
|
||||||
|
@ -909,8 +916,6 @@ class Coder:
|
||||||
else:
|
else:
|
||||||
content = ""
|
content = ""
|
||||||
|
|
||||||
self.io.tool_output()
|
|
||||||
|
|
||||||
if interrupted:
|
if interrupted:
|
||||||
content += "\n^C KeyboardInterrupt"
|
content += "\n^C KeyboardInterrupt"
|
||||||
self.cur_messages += [dict(role="assistant", content=content)]
|
self.cur_messages += [dict(role="assistant", content=content)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue