Merge branch 'fixbug_use_web_as_default_program_language' into fixbug_custom_development_process

This commit is contained in:
黄伟韬 2024-07-31 13:23:10 +08:00
commit 1cff6752b8
8 changed files with 34 additions and 18 deletions

View file

@ -33,7 +33,7 @@ class Architect(RoleZero):
name: str = "Bob"
profile: str = "Architect"
goal: str = "design a concise, usable, complete software system."
goal: str = "design a concise, usable, complete software system. ouput the system design and 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

@ -9,7 +9,7 @@ from metagpt.strategy.experience_retriever import ENGINEER_EXAMPLE
class Engineer2(RoleZero):
name: str = "Alex"
profile: str = "Engineer"
goal: str = "Take on game, app, and web development"
goal: str = "Take on game, app, and web development."
instruction: str = ENGINEER2_INSTRUCTION
tools: list[str] = ["Plan", "Editor:write,read", "RoleZero", "ReviewAndRewriteCode"]

View file

@ -9,7 +9,7 @@ from typing import Callable, Dict, List, Literal, Tuple
from pydantic import model_validator
from metagpt.actions import Action, UserRequirement
from metagpt.actions.anaylze_requirements import AnalyzeRequirementsRestrictions
from metagpt.actions.analyze_requirements import AnalyzeRequirementsRestrictions
from metagpt.actions.di.run_command import RunCommand
from metagpt.exp_pool import exp_cache
from metagpt.exp_pool.context_builders import RoleZeroContextBuilder
@ -47,6 +47,7 @@ class RoleZero(Role):
goal: str = ""
system_msg: list[str] = None # Use None to conform to the default value at llm.aask
cmd_prompt: str = CMD_PROMPT
thought_guidance: str = THOUGHT_GUIDANCE
instruction: str = ROLE_INSTRUCTION
task_type_desc: str = None
@ -161,7 +162,7 @@ class RoleZero(Role):
plan_status=plan_status,
current_task=current_task,
instruction=instruction,
thought_guidance=THOUGHT_GUIDANCE,
thought_guidance=self.thought_guidance,
latest_observation=memory[-1].content,
requirements_constraints=self.requirements_constraints,
)
@ -214,7 +215,7 @@ class RoleZero(Role):
self.rc.memory.add(UserMessage(content=outputs))
return AIMessage(
content=f"{self.name} has finished the task, mark it as finished. Complete run with outputs: {outputs}",
content=f"I have finished the task, please mark my task as finished. Outputs: {outputs}",
sent_from=self.name,
cause_by=RunCommand,
)

View file

@ -6,6 +6,7 @@ from metagpt.prompts.di.team_leader import (
QUICK_THINK_SYSTEM_PROMPT,
SYSTEM_PROMPT,
TL_INSTRUCTION,
TL_THOUGHT_GUIDANCE,
)
from metagpt.roles.di.role_zero import RoleZero
from metagpt.schema import AIMessage, Message, UserMessage
@ -55,6 +56,7 @@ class TeamLeader(RoleZero):
async def _think(self) -> bool:
self.instruction = TL_INSTRUCTION.format(team_info=self._get_team_info())
self.thought_guidance = TL_THOUGHT_GUIDANCE
return await super()._think()
def publish_message(self, msg: Message, send_to="no one"):