Fix format issues

This commit is contained in:
黄伟韬 2024-07-31 19:34:12 +08:00
parent 8edd764066
commit 78cc39c5f9
5 changed files with 10 additions and 7 deletions

View file

@ -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:

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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"):