add action history even when empty (#1939)
This commit is contained in:
@@ -1563,7 +1563,7 @@ class ForgeAgent:
|
|||||||
for action, results in actions_and_results
|
for action, results in actions_and_results
|
||||||
if len(results) > 0
|
if len(results) > 0
|
||||||
]
|
]
|
||||||
return json.dumps(action_history) if action_history else ""
|
return json.dumps(action_history)
|
||||||
|
|
||||||
async def get_extracted_information_for_task(self, task: Task) -> dict[str, Any] | list | str | None:
|
async def get_extracted_information_for_task(self, task: Task) -> dict[str, Any] | list | str | None:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -40,14 +40,12 @@ Reply in JSON format with the following keys:
|
|||||||
"verification_code_reasoning": str, // Let's think step by step. Describe what you see and think if a verification code is needed for login or any verification step. Explain why you believe a verification code is needed or not. Has the code been sent and is code available somewhere (email, phone or 2FA device)?
|
"verification_code_reasoning": str, // Let's think step by step. Describe what you see and think if a verification code is needed for login or any verification step. Explain why you believe a verification code is needed or not. Has the code been sent and is code available somewhere (email, phone or 2FA device)?
|
||||||
"need_verification_code": bool, // Whether a verification code must be entered on this page now. True only if the code is available to user. If the code is not sent, return false {% endif %}
|
"need_verification_code": bool, // Whether a verification code must be entered on this page now. True only if the code is available to user. If the code is not sent, return false {% endif %}
|
||||||
}
|
}
|
||||||
{% if action_history %}
|
|
||||||
Consider the action history from the last step and the screenshot together, if actions from the last step don't yield positive impact, try other actions or other action combinations.
|
|
||||||
|
|
||||||
|
Consider the action history from the last step and the screenshot together, if actions from the last step don't yield positive impact, try other actions or other action combinations.
|
||||||
Action history from previous steps: (note: even if the action history suggests goal is achieved, check the screenshot and the DOM elements to make sure the goal is achieved)
|
Action history from previous steps: (note: even if the action history suggests goal is achieved, check the screenshot and the DOM elements to make sure the goal is achieved)
|
||||||
```
|
```
|
||||||
{{ action_history }}
|
{{ action_history }}
|
||||||
```
|
```
|
||||||
{% endif %}
|
|
||||||
{% if complete_criterion %}
|
{% if complete_criterion %}
|
||||||
Complete criterion:
|
Complete criterion:
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ async def personalize_action(
|
|||||||
ActionType.COMPLETE,
|
ActionType.COMPLETE,
|
||||||
ActionType.WAIT,
|
ActionType.WAIT,
|
||||||
ActionType.SOLVE_CAPTCHA,
|
ActionType.SOLVE_CAPTCHA,
|
||||||
|
ActionType.NULL_ACTION,
|
||||||
]:
|
]:
|
||||||
return [action]
|
return [action]
|
||||||
elif action.action_type == ActionType.TERMINATE:
|
elif action.action_type == ActionType.TERMINATE:
|
||||||
|
|||||||
Reference in New Issue
Block a user