From 21775647b5f2ebd84e21db1d101806cd546cede8 Mon Sep 17 00:00:00 2001 From: garylin2099 Date: Mon, 29 Jul 2024 13:58:28 +0800 Subject: [PATCH] minor update on prompt --- metagpt/actions/write_prd.py | 2 +- metagpt/prompts/di/role_zero.py | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/metagpt/actions/write_prd.py b/metagpt/actions/write_prd.py index ae1b5dd81..a062ece54 100644 --- a/metagpt/actions/write_prd.py +++ b/metagpt/actions/write_prd.py @@ -108,7 +108,7 @@ class WritePRD(Action): Example: # Write a new PRD (Product Requirement Document) - >>> user_requirement = "Write PRD for a snake game" + >>> user_requirement = "Write a snake game" >>> output_pathname = "snake_game/docs/prd.json" >>> extra_info = "YOUR EXTRA INFO, if any" >>> write_prd = WritePRD() diff --git a/metagpt/prompts/di/role_zero.py b/metagpt/prompts/di/role_zero.py index f0f11754a..478f5c0d4 100644 --- a/metagpt/prompts/di/role_zero.py +++ b/metagpt/prompts/di/role_zero.py @@ -65,17 +65,18 @@ Notice: your output JSON data must be a command list. Notice: your output JSON data section must start with **```json [** """ THOUGHT_GUIDANCE = """ -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 the plan status and the current task. Review the histroy, if `Current Task` has been undertaken and completed by you or anyone, you MUST use the **Plan.finish_current_task** command to finish it first before taking any action, the command will automatically move you to the next task. -Fourthly, describe any necessary human interaction. Use **RoleZero.reply_to_human** to report your progress, pay attention to the history, DON'T repeat reporting. Use **RoleZero.ask_human** if you failed the current task or if you are unsure of the situation encountered or if you need any help from human. -Fifthly, describe if you should terminate, you should use **end** command to terminate if any of the following is met: +First, describe the actions you have taken recently. +Second, describe the messages you have received recently, with a particular emphasis on messages from users. +Third, describe the plan status and the current task. Review the histroy, if `Current Task` has been undertaken and completed by you or anyone, you MUST use the **Plan.finish_current_task** command to finish it first before taking any action, the command will automatically move you to the next task. +Fourth, describe any necessary human interaction. Use **RoleZero.reply_to_human** to report your progress if you complete a task or the overall requirement, pay attention to the history, DON'T repeat reporting. Use **RoleZero.ask_human** if you failed the current task, unsure of the situation encountered, need any help from human, or executing repetitive commands but receiving repetitive feedbacks without making progress. +Fifth, describe if you should terminate, you should use **end** command to terminate if any of the following is met: - You have completed the overall user requirement - All tasks are finished and current task is empty + - You are repetitively replying to human Finally, combine your thoughts, describe what you want to do conscisely in 20 words, then follow your thoughts to list the commands, adhering closely to the instructions provided. """.strip() REGENERATE_PROMPT = """ -Review and reflect on the history carefully, provide different commands. +Review and reflect on the history carefully, provide a different response. Describe if you should terminate using **end** command, or use **RoleZero.ask_human** to ask human for help, or try a different approach and output different commands. You are NOT allowed to provide the same commands again. Your reflection, then the commands in a json array: """