From 5cda228f5b77ac246744565911b8523321ba7196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Fri, 27 Sep 2024 16:18:10 +0800 Subject: [PATCH] fix typo --- metagpt/roles/di/role_zero.py | 4 +++- metagpt/tools/libs/editor.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.py index 9fca8f468..b8aedcdd6 100644 --- a/metagpt/roles/di/role_zero.py +++ b/metagpt/roles/di/role_zero.py @@ -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 "" 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: diff --git a/metagpt/tools/libs/editor.py b/metagpt/tools/libs/editor.py index ca8cd9ccf..5391ff48a 100644 --- a/metagpt/tools/libs/editor.py +++ b/metagpt/tools/libs/editor.py @@ -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: