From dbefcb9e44bf92cc0e64da0586da1dc348147a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Mon, 9 Sep 2024 17:39:30 +0800 Subject: [PATCH] remove requirement analyze --- metagpt/prompts/di/engineer2.py | 1 + metagpt/prompts/di/role_zero.py | 7 +++++-- metagpt/prompts/di/team_leader.py | 3 ++- metagpt/roles/di/role_zero.py | 2 -- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/metagpt/prompts/di/engineer2.py b/metagpt/prompts/di/engineer2.py index 70e45acb5..690384471 100644 --- a/metagpt/prompts/di/engineer2.py +++ b/metagpt/prompts/di/engineer2.py @@ -76,6 +76,7 @@ Note: 19. When the requirement is simple, you don't need to create a plan, just do it right away. 20. If the code exists, use the Editor tool's open and edit commands to modify it. Since it is not a new code, do not use write_new_code. 21. When using the editor, pay attention to the editor's current directory. When you use editor tools, the paths must be either absolute or relative to the editor's current directory. +22. The default programming languages are HTML (.html), CSS (.css), and JavaScript (.js). """ CURRENT_STATE = """ The current editor state is: diff --git a/metagpt/prompts/di/role_zero.py b/metagpt/prompts/di/role_zero.py index a6b111d95..bc14cc555 100644 --- a/metagpt/prompts/di/role_zero.py +++ b/metagpt/prompts/di/role_zero.py @@ -44,8 +44,11 @@ Special Command: Use {{"command_name": "end"}} to do nothing or indicate complet # Example {example} -# Instruction +# Role Instruction {instruction} + +# Common Instruction +1. Choose a language the user can understand for responding. Usually, use the same as the user's message. """ CMD_EXPERIENCE_MASK = f""" @@ -87,9 +90,9 @@ Output should adhere to the following format. ] ``` Notice: your output JSON data section must start with **```json [** +Firstly, the language of the response is... """ ) - THOUGHT_GUIDANCE = """ First, describe the actions you have taken recently. Second, describe the messages you have received recently, with a particular emphasis on messages from users. If necessary, develop a plan to address the new user requirements. diff --git a/metagpt/prompts/di/team_leader.py b/metagpt/prompts/di/team_leader.py index 8d85a8cf3..6f3ebb129 100644 --- a/metagpt/prompts/di/team_leader.py +++ b/metagpt/prompts/di/team_leader.py @@ -32,8 +32,9 @@ Note: 9. Do not use the 'end' command when the current task remains unfinished; instead, use the 'finish_current_task' command to indicate completion before switching to the next task. 10. Do not use escape characters in json data, particularly within file paths. 11. Analyze the capabilities of team members and assign tasks to them based on user Requirements. If the requirements ask to ignore certain tasks, follow the requirements. -12. Add default web technologies: HTML (*.html), CSS (*.css), and JavaScript (*.js) to your requirements.If no specific programming language is required, include these technologies in the project requirements. Using instruction to forward this information to your team members. +12. If the requirement doesn't specify, use HTML (.html), CSS (.css), and JavaScript (.js) as the default languages. Report this to your team member. 13. If the the user message is a question. use 'reply to human' to respond to the question, and then end. +14. Instructions and reply must be in the same language. """ TL_THOUGHT_GUIDANCE = ( THOUGHT_GUIDANCE diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.py index db8d2aa5f..58925ce99 100644 --- a/metagpt/roles/di/role_zero.py +++ b/metagpt/roles/di/role_zero.py @@ -10,7 +10,6 @@ from typing import Annotated, Callable, Dict, List, Literal, Optional, Tuple from pydantic import Field, model_validator from metagpt.actions import Action, UserRequirement -from metagpt.actions.analyze_requirements import AnalyzeRequirementsRestrictions from metagpt.actions.di.run_command import RunCommand from metagpt.actions.search_enhanced_qa import SearchEnhancedQA from metagpt.const import IMAGES @@ -179,7 +178,6 @@ class RoleZero(Role): if not self.planner.plan.goal: self.planner.plan.goal = self.get_memories()[-1].content - self.requirements_constraints = await AnalyzeRequirementsRestrictions().run(self.planner.plan.goal) ### 1. Experience ### example = self._retrieve_experience()