🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
Merge branch 'mgx_ops' into basic_ability
garylin20994cc47366f876
diff --cc metagpt/roles/di/role_zero.pyindex a1640768e,40bc2e3c7..9355ef8ab--- a/metagpt/roles/di/role_zero.py+++ b/metagpt/roles/di/role_zero.py@@@ -214,15 -242,14 +241,16 @@@ class RoleZero(Role)# Agents themselves won't generate quick questions, use this rule to reduce extra llm callsreturn rsp_msg- context = self.llm.format_msg(self.get_memories(k=4) + [UserMessage(content=QUICK_THINK_PROMPT)])- async with ThoughtReporter(enable_llm_stream=True) as reporter:- await reporter.async_report({"type": "quick"})- rsp = await self.llm.aask(context)+ # routing+ memory = self.get_memories(k=4)+ context = self.llm.format_msg(memory + [UserMessage(content=QUICK_THINK_PROMPT)])- # print(context)+ rsp = await self.llm.aask(context)- pattern = r"#YES#,? ?"- if re.search(pattern, rsp):- answer = re.sub(pattern, "", rsp).strip()+ if "yes" in rsp.lower():+ # llm call with the original context- answer = await self.llm.aask(self.llm.format_msg(memory))++ async with ThoughtReporter(enable_llm_stream=True) as reporter:++ await reporter.async_report({"type": "quick"})++ answer = await self.llm.aask(self.llm.format_msg(memory))self.rc.memory.add(AIMessage(content=answer, cause_by=RunCommand))await self.reply_to_human(content=answer)rsp_msg = AIMessage(diff --cc metagpt/roles/di/team_leader.pyindex 3781f1a24,7915edcf6..6dde4565e--- a/metagpt/roles/di/team_leader.py+++ b/metagpt/roles/di/team_leader.py@@@ -15,9 -14,8 +15,9 @@@ from metagpt.tools.tool_registry impor@register_tool(include_functions=["publish_team_message"])class TeamLeader(RoleZero):- name: str = "Tim"+ name: str = "Mike"profile: str = "Team Leader"+ goal: str = "Manage a team to assist users"system_msg: list[str] = [SYSTEM_PROMPT]# TeamLeader only reacts once each time, but may encounter errors or need to ask human, thus allowing 2 more turns