This commit is contained in:
黄伟韬 2024-09-27 16:18:10 +08:00
parent e343def831
commit 5cda228f5b
2 changed files with 5 additions and 3 deletions

View file

@ -568,7 +568,9 @@ class RoleZero(Role):
"""This fucntion will call ask_human and then analyze and decorate the human response."""
human_response = await self.ask_human(question)
if "<STOP>" in human_response:
human_response += f"\nUser ask you to stop the current task immediately.\nIn your next response, use end command to stop the current task.\nLike:\n{END_COMMAND}"
human_response += "\nCommand end executed:"
human_response += await self._end()
return human_response
return human_response
async def reply_to_human(self, content: str) -> str:

View file

@ -773,8 +773,8 @@ class Editor(BaseModel):
lines = content.splitlines(True)
total_lines = len(lines)
check_list = [
("first_replaced", first_replaced_line_number, first_replaced_line_content),
("last_replaced", last_replaced_line_number, last_replaced_line_content),
("first", first_replaced_line_number, first_replaced_line_content),
("last", last_replaced_line_number, last_replaced_line_content),
]
for position, line_number, line_content in check_list:
if lines[line_number - 1].rstrip() != line_content: