feat: +exported function

This commit is contained in:
莘权 马 2023-08-27 10:41:34 +08:00
parent 1545a702cc
commit ee77d4b0fb

View file

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