Skip to content

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

feat: +todo_description

莘权 马93d6bc6569e4
diff --git a/metagpt/roles/role.py b/metagpt/roles/role.py
index 286c87eb1..c57bf4f43 100644
--- a/metagpt/roles/role.py
+++ b/metagpt/roles/role.py
@@ -341,3 +341,11 @@ class Role:
msg = await self._act()
return ActionOutput(content=msg.content,
instruct_content=msg.instruct_content)
+
+ @property
+ def todo_description(self):
+ if not self._rc or not self._rc.todo:
+ return ""
+ if self._rc.todo.desc:
+ return self._rc.todo.desc
+ return f"{self._rc.todo.__class__}"