feat: +note

This commit is contained in:
莘权 马 2024-01-22 10:50:32 +08:00
parent 8b84e269a1
commit bda2e06d36

View file

@ -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: