Skip to content

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

fix format issues

黄伟韬ca66af381a8f
diff --git a/metagpt/prompts/di/role_zero.py b/metagpt/prompts/di/role_zero.py
index caba52e57..ce8c61dd5 100644
--- a/metagpt/prompts/di/role_zero.py
+++ b/metagpt/prompts/di/role_zero.py
@@ -229,7 +229,7 @@ Do not output any other format.
Your reply is:
"""
-SUMMARY_PROMPY = """
+SUMMARY_PROMPT = """
# Restrictions
{requirements_constraints}
diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.py
index 8dfd888d2..4e61ceab3 100644
--- a/metagpt/roles/di/role_zero.py
+++ b/metagpt/roles/di/role_zero.py
@@ -28,7 +28,7 @@ from metagpt.prompts.di.role_zero import (
REGENERATE_PROMPT,
REPORT_TO_HUMAN_PROMPT,
ROLE_INSTRUCTION,
- SUMMARY_PROMPY,
+ SUMMARY_PROMPT,
SYSTEM_PROMPT,
THOUGHT_GUIDANCE,
)
@@ -485,9 +485,9 @@ class RoleZero(Role):
async def _end(self):
self._set_state(-1)
+ memory = self.rc.memory.get(self.memory_k)
# Ensure reply to the human before the "end" command is executed.
if not any(["reply_to_human" in memory.content for memory in self.get_memories(k=5)]):
- memory = self.rc.memory.get(self.memory_k)
reply_to_human_prompt = REPORT_TO_HUMAN_PROMPT.format(
requirements_constraints=self.requirements_constraints,
)
@@ -497,8 +497,7 @@ class RoleZero(Role):
outputs = ""
# Summary of the Completed Task and Deliverables
if self.use_summary:
- memory = self.rc.memory.get(self.memory_k)
- summary_prompt = SUMMARY_PROMPY.format(
+ summary_prompt = SUMMARY_PROMPT.format(
requirements_constraints=self.requirements_constraints,
)
outputs = await self.llm.aask(self.llm.format_msg(memory + [UserMessage(summary_prompt)]))