From 48b8a941b955b149d56183b4a737c602f454772a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Wed, 24 Jul 2024 11:23:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E5=92=8C=E4=BB=BB=E5=8A=A1=E8=80=A6=E5=90=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/actions/design_api.py | 2 +- metagpt/actions/write_code_review.py | 2 +- metagpt/prompts/di/role_zero.py | 1 + metagpt/tools/libs/editor.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/metagpt/actions/design_api.py b/metagpt/actions/design_api.py index 322108dbb..3eb8fe04d 100644 --- a/metagpt/actions/design_api.py +++ b/metagpt/actions/design_api.py @@ -279,4 +279,4 @@ class WriteDesign(Action): md_output_filename = output_pathname.with_suffix(".md") await save_json_to_markdown(content=design.content, output_filename=md_output_filename) await reporter.async_report(md_output_filename, "path") - return f'System Design filename: "{str(output_pathname)}". \n The System Design has been completed and is now marked as finished.' + return f'System Design filename: "{str(output_pathname)}". \n The System Design has been completed.' diff --git a/metagpt/actions/write_code_review.py b/metagpt/actions/write_code_review.py index f49ef178f..ca174f2ee 100644 --- a/metagpt/actions/write_code_review.py +++ b/metagpt/actions/write_code_review.py @@ -284,7 +284,7 @@ class ReviewAndRewriteCode(Action): await awrite(filename=code_path, data=code) return ( - f'\nThe "review and rewrite the code {os.path.basename(code_path)}" task has been completed and is now marked as finished.\n' + f"The review and rewriting of the code in the file '{os.path.basename(code_path)}' has been completed." + code ) diff --git a/metagpt/prompts/di/role_zero.py b/metagpt/prompts/di/role_zero.py index 0e2126880..4e75efcfe 100644 --- a/metagpt/prompts/di/role_zero.py +++ b/metagpt/prompts/di/role_zero.py @@ -50,6 +50,7 @@ In your response, include at least one command. # Your commands in a json array, in the following output format with correct command_name and args. If there is nothing to do, use the pass or end command: Some text indicating your thoughts before JSON is required, such as what tasks have been completed, what tasks are next, how you should update the plan status, respond to inquiry, or seek for help. Then a json array of commands. You must output ONE and ONLY ONE json array. DON'T output multiple json arrays with thoughts between them. +Output should adhere to the following format. Firstly, describe the actions you have taken recently. Secondly, describe the messages you have received recently, with a particular emphasis on messages from users. Thirdly, describe your current task . Review the histroy, if you find that the current task is identical to a previously completed one, it indicates that the current task has already been accomplished. diff --git a/metagpt/tools/libs/editor.py b/metagpt/tools/libs/editor.py index 044618d79..4c6d2b1dc 100644 --- a/metagpt/tools/libs/editor.py +++ b/metagpt/tools/libs/editor.py @@ -36,7 +36,7 @@ class Editor: with open(path, "w", encoding="utf-8") as f: f.write(content) # self.resource.report(path, "path") - return f" The task of writing/coding the '{os.path.basename(path)}' file has been completed. The file '{os.path.basename(path)}' has been successfully created." + return f"The writing/coding the of the file {os.path.basename(path)}' is now completed. The file '{os.path.basename(path)}' has been successfully created." def read(self, path: str) -> FileBlock: """Read the whole content of a file. Using absolute paths as the argument for specifying the file location."""