mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-05 14:55:18 +02:00
feat: +note
This commit is contained in:
parent
8b84e269a1
commit
bda2e06d36
1 changed files with 10 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue