From bda2e06d368e1c80306d441a7ce80da57d5d62f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Mon, 22 Jan 2024 10:50:32 +0800 Subject: [PATCH] feat: +note --- metagpt/roles/role.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/metagpt/roles/role.py b/metagpt/roles/role.py index c363d332c..28d2fe693 100644 --- a/metagpt/roles/role.py +++ b/metagpt/roles/role.py @@ -523,19 +523,26 @@ class Role(SerializationMixin, ContextMixin, BaseModel): return not self.rc.news and not self.rc.todo and self.rc.msg_buffer.empty() async def think(self) -> Action: - """The exported `think` function""" - await self._observe() + """ + Export SDK API, used by AgentStore RPC. + The exported `think` function + """ + await self._observe() # For compatibility with the old version of the Agent. await self._think() return self.rc.todo async def act(self) -> ActionOutput: - """The exported `act` function""" + """ + Export SDK API, used by AgentStore RPC. + The exported `act` function + """ msg = await self._act() return ActionOutput(content=msg.content, instruct_content=msg.instruct_content) @property def action_description(self) -> str: """ + Export SDK API, used by AgentStore RPC. AgentStore uses this attribute to display to the user what actions the current role should take. """ if self.rc.todo: