This commit is contained in:
better629 2024-03-27 22:50:04 +08:00
parent 257553d64d
commit 9435f115af
2 changed files with 3 additions and 4 deletions

View file

@ -160,8 +160,7 @@ class SelfLearnAndReflect(Action):
action = "h_swipe"
else:
# TODO Test for assignment, This error is eupiped with the next.
logger.info(f"Warning: current action name:{self.act_name}")
logger.info("Warning: act_name parse wrong!")
logger.warning(f"Current action name parse failed, it's `{self.act_name}`")
action = None
context = reflect_template.format(
action=action, ui_element=str(self.ui_area), task_desc=task_desc, last_act=last_act

View file

@ -89,9 +89,9 @@ class AndroidAssistant(Role):
"""ignore old memory to make it run multi rounds inside a role"""
newest_msgs = self.rc.memory.get(k=1)
newest_msg = newest_msgs[0] if newest_msgs else None
if newest_msg and (RunState.SUCCESS.value not in newest_msg.content):
if newest_msg and (RunState.FAIL.value in newest_msg.content):
ignore_memory = False
logger.error("Latest action_state is FINISH or FAIL, won't react in remainder rounds")
logger.error("Latest action_state is FAIL, won't react in remainder rounds")
return await super()._observe(ignore_memory)
async def _act(self) -> Message: