mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
better
This commit is contained in:
parent
2691c80ac2
commit
6c87d5be1c
5 changed files with 33 additions and 8 deletions
|
@ -64,6 +64,20 @@ class EditBlockFunctionCoder(Coder):
|
|||
self.gpt_prompts = EditBlockFunctionPrompts()
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def update_cur_messages(self, content, edited):
|
||||
if self.partial_response_content:
|
||||
self.cur_messages += [dict(role="assistant", content=self.partial_response_content)]
|
||||
if self.partial_response_function_call:
|
||||
self.cur_messages += [
|
||||
dict(
|
||||
role="assistant",
|
||||
content=None,
|
||||
function_call=self.partial_response_function_call,
|
||||
)
|
||||
]
|
||||
|
||||
dump(self.cur_messages)
|
||||
|
||||
def render_incremental_response(self, final=False):
|
||||
if self.partial_response_content:
|
||||
return self.partial_response_content
|
||||
|
@ -87,8 +101,8 @@ class EditBlockFunctionCoder(Coder):
|
|||
edited = set()
|
||||
for edit in edits:
|
||||
path = get_arg(edit, "path")
|
||||
original = get_arg(edit, "original_lines")
|
||||
updated = get_arg(edit, "updated_lines")
|
||||
original = "\n".join(get_arg(edit, "original_lines")) + "\n"
|
||||
updated = "\n".join(get_arg(edit, "updated_lines")) + "\n"
|
||||
|
||||
full_path = self.allowed_to_edit(path)
|
||||
if not full_path:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue