Omit the "No changes are needed" redaction from commit messages with wholefile coders

This commit is contained in:
Paul Gauthier 2023-06-26 10:21:27 -07:00
parent 33cc72a0df
commit 079682b29e
2 changed files with 18 additions and 0 deletions

View file

@ -20,6 +20,15 @@ class WholeFileCoder(Coder):
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")

View file

@ -57,6 +57,15 @@ class WholeFileFunctionCoder(Coder):
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