diff --git a/metagpt/prompts/di/team_leader.py b/metagpt/prompts/di/team_leader.py index b3eeda1a2..2f3e69651 100644 --- a/metagpt/prompts/di/team_leader.py +++ b/metagpt/prompts/di/team_leader.py @@ -1,3 +1,5 @@ +from metagpt.prompts.di.role_zero import THOUGHT_GUIDANCE + SYSTEM_PROMPT = """ You are a team leader, and you are responsible for drafting tasks and routing tasks to your team members. When drafting and routing tasks, ALWAYS include necessary or important info inside the instruction, such as path, link, environment to team members, because you are their sole info source. @@ -29,10 +31,13 @@ Note: 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. """ -TL_THOUGHT_GUIDANCE = """ +TL_THOUGHT_GUIDANCE = ( + THOUGHT_GUIDANCE + + """ Sixth, when planning, describe the requirements as they pertain to software development, data analysis, or other areas. If the requirements is a software development and no specific restrictions are mentioned, you must create a Product Requirements Document (PRD), write a System Design document, develop a project schedule, and then begin coding. List the steps you will undertake. Plan these steps in a single response. Seventh, describe the technologies you must use. """ +) QUICK_THINK_SYSTEM_PROMPT = """ {role_info} Your team member: diff --git a/metagpt/roles/architect.py b/metagpt/roles/architect.py index 52b450a6a..e37f00913 100644 --- a/metagpt/roles/architect.py +++ b/metagpt/roles/architect.py @@ -33,7 +33,7 @@ class Architect(RoleZero): name: str = "Bob" profile: str = "Architect" - goal: str = "design a concise, usable, complete software system. ouput the system design and software framework." + goal: str = "design a concise, usable, complete software system. ouput the system design or software framework." constraints: str = ( "make sure the architecture is simple enough and use appropriate open source " "libraries. Use same language as user requirement" diff --git a/metagpt/roles/di/data_analyst.py b/metagpt/roles/di/data_analyst.py index b9156d365..3a43f72e0 100644 --- a/metagpt/roles/di/data_analyst.py +++ b/metagpt/roles/di/data_analyst.py @@ -134,7 +134,7 @@ class DataAnalyst(RoleZero): # finish current task before end. command_output = "" if cmd["command_name"] == "end" and not self.planner.plan.is_plan_finished(): - self.planner.plan.finish_all_task() + self.planner.plan.finish_all_tasks() command_output += "All tasks are finished.\n" command_output += await super()._run_special_command(cmd) return command_output diff --git a/metagpt/roles/di/engineer2.py b/metagpt/roles/di/engineer2.py index ed0efa75b..fbade0421 100644 --- a/metagpt/roles/di/engineer2.py +++ b/metagpt/roles/di/engineer2.py @@ -32,7 +32,7 @@ class Engineer2(RoleZero): # finish current task before end. command_output = "" if cmd["command_name"] == "end" and not self.planner.plan.is_plan_finished(): - self.planner.plan.finish_all_task() + self.planner.plan.finish_all_tasks() command_output += "All tasks are finished.\n" command_output += await super()._run_special_command(cmd) return command_output diff --git a/metagpt/roles/di/team_leader.py b/metagpt/roles/di/team_leader.py index a8aec75f6..f495c4aaa 100644 --- a/metagpt/roles/di/team_leader.py +++ b/metagpt/roles/di/team_leader.py @@ -1,7 +1,6 @@ from __future__ import annotations from metagpt.actions.di.run_command import RunCommand -from metagpt.prompts.di.role_zero import THOUGHT_GUIDANCE from metagpt.prompts.di.team_leader import ( FINISH_CURRENT_TASK_CMD, QUICK_THINK_SYSTEM_PROMPT, @@ -21,7 +20,7 @@ class TeamLeader(RoleZero): profile: str = "Team Leader" goal: str = "Manage a team to assist users" system_msg: list[str] = [SYSTEM_PROMPT] - + thought_guidance: str = TL_THOUGHT_GUIDANCE # TeamLeader only reacts once each time, but may encounter errors or need to ask human, thus allowing 2 more turns max_react_loop: int = 3 @@ -57,7 +56,6 @@ class TeamLeader(RoleZero): async def _think(self) -> bool: self.instruction = TL_INSTRUCTION.format(team_info=self._get_team_info()) - self.thought_guidance = THOUGHT_GUIDANCE + TL_THOUGHT_GUIDANCE return await super()._think() def publish_message(self, msg: Message, send_to="no one"):