Skip to content

Commit

Permalink
Omit the "No changes are needed" redaction from commit messages with …
Browse files Browse the repository at this point in the history
…wholefile coders
  • Loading branch information
paul-gauthier committed Jun 26, 2023
1 parent 33cc72a commit 079682b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aider/coders/wholefile_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ def update_cur_messages(self, content, edited):
else:
self.cur_messages += [dict(role="assistant", content=content)]

def get_context_from_history(self, history):
context = ""
if history:
context += "# Context:\n"
for msg in history:
if msg["role"] == "user":
context += msg["role"].upper() + ": " + msg["content"] + "\n"
return context

def render_incremental_response(self, final):
return self.update_files(mode="diff")

Expand Down
9 changes: 9 additions & 0 deletions aider/coders/wholefile_func_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ def update_cur_messages(self, content, edited):
else:
self.cur_messages += [dict(role="assistant", content=content)]

def get_context_from_history(self, history):
context = ""
if history:
context += "# Context:\n"
for msg in history:
if msg["role"] == "user":
context += msg["role"].upper() + ": " + msg["content"] + "\n"
return context

def render_incremental_response(self, final=False):
if self.partial_response_content:
return self.partial_response_content
Expand Down

0 comments on commit 079682b

Please sign in to comment.