mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-04 21:32:38 +02:00
feat: +exported function
This commit is contained in:
parent
1545a702cc
commit
ee77d4b0fb
1 changed files with 8 additions and 1 deletions
|
|
@ -328,9 +328,16 @@ class Role:
|
|||
self._rc.todo = act
|
||||
|
||||
async def think(self) -> bool:
|
||||
return await self._think()
|
||||
"""The exported `think` function"""
|
||||
has_action = await self._think()
|
||||
if not has_action:
|
||||
return False
|
||||
if not self._rc.todo:
|
||||
return False
|
||||
return True
|
||||
|
||||
async def act(self) -> ActionOutput:
|
||||
"""The exported `act` function"""
|
||||
msg = await self._act()
|
||||
return ActionOutput(content=msg.content,
|
||||
instruct_content=msg.instruct_content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue