Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

fix conflict

seehi1797fdc1f85b
diff --cc metagpt/roles/di/role_zero.py
index 7f3d81b9d,db8d2aa5f..5e1d239c0
--- a/metagpt/roles/di/role_zero.py
+++ b/metagpt/roles/di/role_zero.py
@@@ -276,10 -264,11 +281,11 @@@ class RoleZero(Role)
if self.use_fixed_sop:
return await super()._act()
- commands, ok = await self._parse_commands(self.command_rsp)
+ commands, ok, self.command_rsp = await self._parse_commands(self.command_rsp)
- self.rc.memory.add(AIMessage(content=self.command_rsp))
++ self._add_memory(AIMessage(content=self.command_rsp))
if not ok:
error_msg = commands
- self.rc.memory.add(UserMessage(content=error_msg))
+ self._add_memory(UserMessage(content=error_msg))
return error_msg
logger.info(f"Commands: \n{commands}")
outputs = await self._run_commands(commands)
@@@ -536,11 -543,11 +560,11 @@@
return "Not in MGXEnv, command will not be executed."
return await self.rc.env.reply_to_human(content, sent_from=self)
- async def _end(self):
+ async def _end(self, **kwarg):
self._set_state(-1)
- memory = self.rc.memory.get(self.memory_k)
+ memory = self._fetch_memories()
# Ensure reply to the human before the "end" command is executed. Hard code k=5 for checking.
- if not any(["reply_to_human" in memory.content for memory in self.get_memories(k=5)]):
+ if not any(["reply_to_human" in memory.content for memory in self._fetch_memories(k=5)]):
logger.info("manually reply to human")
pattern = r"\[Language Restrictions\](.*?)\n"
match = re.search(pattern, self.requirements_constraints, re.DOTALL)