fix infeasible&chrome tasks (#258)
* fix chrome * fix: fix proxy setup * feat&fix: add proxy support in setup and remove hardcoded proxy from example * fix tasks * fix chrome finished * fix * clean chrome_fix code * clean chrome_fix code * fix chrome 2888b4e6-5b47-4b57-8bf5-c73827890774 * fix multiapps * fix chrome 2888b4e6-5b47-4b57-8bf5-c73827890774 * fix some multi_apps tasks * fix some multi_apps tasks * fix password&resolution * fix password&resolution * Improve code logic for password & resolution * edit * Merge branch 'main' into fix_chrome * fix chrome tasks * Merge branch 'fix_chrome' * fix insensible&chrome tasks --------- Co-authored-by: adlsdztony <zzl0712@connect.hku.hk>
This commit is contained in:
@@ -671,8 +671,14 @@ class OpenAICUAAgent:
|
||||
action_exit = False
|
||||
thought_exit = False
|
||||
message_exit = False
|
||||
infeasible_message = False
|
||||
infeasible_word_list = ["infeasible", "unfeasible", "impossible", "not feasible", "cannot be done"]
|
||||
for item in response.output:
|
||||
parsed_item = self._handle_item(item)
|
||||
if item.type == "message" and any(word in parsed_item.lower() for word in infeasible_word_list):
|
||||
actions.append({"action_space": "pyautogui", "action": "FAIL", "pending_checks": [], "call_id": ""})
|
||||
infeasible_message = True
|
||||
break
|
||||
if isinstance(parsed_item, dict) and parsed_item.get("action_space", None) == "pyautogui":
|
||||
actions.append(parsed_item)
|
||||
else:
|
||||
@@ -693,7 +699,7 @@ class OpenAICUAAgent:
|
||||
# state_correct = True
|
||||
# if action_exit and not message_exit:
|
||||
# state_correct = True
|
||||
if action_exit:
|
||||
if action_exit and not infeasible_message:
|
||||
state_correct = True
|
||||
if not state_correct:
|
||||
logger.warning("The state of the agent is not correct, action_exit: %s, thought_exit: %s, message_exit: %s", action_exit, thought_exit, message_exit)
|
||||
|
||||
Reference in New Issue
Block a user