From 9908361577b6e3ebe48321ec97586fd8c2b8fccd Mon Sep 17 00:00:00 2001 From: garylin2099 Date: Mon, 19 Aug 2024 17:11:05 +0800 Subject: [PATCH 1/3] correct command output in quick --- metagpt/roles/di/role_zero.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.py index 0209079b9..4810ddb3a 100644 --- a/metagpt/roles/di/role_zero.py +++ b/metagpt/roles/di/role_zero.py @@ -297,6 +297,10 @@ class RoleZero(Role): self.llm.format_msg(memory), system_msgs=[QUICK_RESPONSE_SYSTEM_PROMPT.format(role_info=self._get_prefix())], ) + if "command_name" in answer: + # an actual TASK intent misclassified as QUICK, correct it here + answer = "" + intent_result = "TASK" elif "SEARCH" in intent_result: query = "\n".join(str(msg) for msg in memory) answer = await SearchEnhancedQA().run(query) From f4cea0b985b9e2c61713c8387a89ebba1506c574 Mon Sep 17 00:00:00 2001 From: garylin2099 Date: Tue, 20 Aug 2024 10:25:28 +0800 Subject: [PATCH 2/3] grammar --- metagpt/actions/analyze_requirements.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/metagpt/actions/analyze_requirements.py b/metagpt/actions/analyze_requirements.py index ac412b1d1..d81da3e14 100644 --- a/metagpt/actions/analyze_requirements.py +++ b/metagpt/actions/analyze_requirements.py @@ -24,7 +24,7 @@ Requirements: 创建一个贪吃蛇,只需要给出设计文档和代码 Outputs: [User Restrictions] : 只需要给出设计文档和代码. -[Language Restrictions] : The response, message and instruction must be in the language specified by Chinese. +[Language Restrictions] : The response, message and instruction must be in Chinese. [Programming Language] : HTML (*.html), CSS (*.css), and JavaScript (*.js) Example 2 @@ -32,7 +32,7 @@ Requirements: Create 2048 game using Python. Do not write PRD. Outputs: [User Restrictions] : Do not write PRD. -[Language Restrictions] : The response, message and instruction must be in the language specified by English. +[Language Restrictions] : The response, message and instruction must be in English. [Programming Language] : Python Example 3 @@ -40,7 +40,7 @@ Requirements: You must ignore create PRD and TRD. Help me write a schedule display program for the Paris Olympics. Outputs: [User Restrictions] : You must ignore create PRD and TRD. -[Language Restrictions] : The response, message and instruction must be in the language specified by English. +[Language Restrictions] : The response, message and instruction must be in English. [Programming Language] : HTML (*.html), CSS (*.css), and JavaScript (*.js) """ @@ -57,7 +57,7 @@ Note: OUTPUT_FORMAT = """ [User Restrictions] : the restrictions in the requirements -[Language Restrictions] : The response, message and instruction must be in the language specified by {{language}} +[Language Restrictions] : The response, message and instruction must be in {{language}} [Programming Language] : Your program must use ... """ From 968cf118190d15528140d00a8573eb89b2cfe0a3 Mon Sep 17 00:00:00 2001 From: garylin2099 Date: Tue, 20 Aug 2024 11:25:18 +0800 Subject: [PATCH 3/3] add comment --- metagpt/roles/di/role_zero.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.py index 4810ddb3a..52feddb56 100644 --- a/metagpt/roles/di/role_zero.py +++ b/metagpt/roles/di/role_zero.py @@ -298,7 +298,7 @@ class RoleZero(Role): system_msgs=[QUICK_RESPONSE_SYSTEM_PROMPT.format(role_info=self._get_prefix())], ) if "command_name" in answer: - # an actual TASK intent misclassified as QUICK, correct it here + # an actual TASK intent misclassified as QUICK, correct it here, FIXME: a better way is to classify it correctly in the first place answer = "" intent_result = "TASK" elif "SEARCH" in intent_result: