add new workflow block (#1228)

This commit is contained in:
LawyZheng
2024-11-21 15:12:26 +08:00
committed by GitHub
parent 4271ca9ecf
commit 3f209404f7
16 changed files with 483 additions and 13 deletions

View File

@@ -0,0 +1,55 @@
Your are here to help the user determine if the current page has met the complete/terminte criterion. Use the criterions of complete/terminate, the content of the elements parsed from the page, the screenshots of the page, and user details to determine whether the criterions has been met.
Reply in JSON format with the following keys:
{
"page_info": str, // Think step by step. Describe all the useful information in the page related to the complete/terminate criterion.
"thoughts": str, // Think step by step. What information makes you believe whether and which criterion has been met. Use information you see on the site to explain.
"actions": array // You are supposed to give only one action("COMPLETE" or "TERMINATE") in the action list. Here's the format of the action:
[{
"reasoning": str, // The reasoning behind the action. This reasoning must be user information agnostic. Mention why you chose the action type, and why you chose the element id. Keep the reasoning short and to the point.
"confidence_float": float, // The confidence of the action. Pick a number between 0.0 and 1.0. 0.0 means no confidence, 1.0 means full confidence
"action_type": str, // It's a string enum: "COMPLETE", "TERMINATE". "COMPLETE" is used when the current page info has met the complete criterion. If there is no complete criterion, use "COMPLETE" as long as the page info hasn't met the terminate criterion. "TERMINATE" is used to terminate with a failure when the current page info has met the terminate criterion. It there is no terminate criterion, use "TERMINATE" as long as the page info hasn't met the complete criterion.
{% if error_code_mapping_str %}
"errors": array // A list of errors. This is used to surface any errors that matches the current situation for COMPLETE and TERMINATE actions. For other actions or if no error description suits the current situation on the screenshots, return an empty list. You are allowed to return multiple errors if there are multiple errors on the page.
[{
"error_code": str, // The error code from the user's error code list
"reasoning": str, // The reasoning behind the error. Be specific, referencing any user information and their fields in your reasoning. Keep the reasoning short and to the point.
"confidence_float": float // The confidence of the error. Pick a number between 0.0 and 1.0. 0.0 means no confidence, 1.0 means full confidence
}]
{% endif %}
}]
}
HTML elements from `{{ current_url }}`:
```
{{ elements }}
```
The URL of the page you're on right now is `{{ current_url }}`.
{% if complete_criterion %}
Complete Criterion:
```
{{ complete_criterion }}
```{% endif %}
{% if terminate_criterion %}
Terminate Criterion:
```
{{ terminate_criterion }}
```{% endif %}
{% if error_code_mapping_str %}
Use the error codes and their descriptions to surface user-defined errors. Do not return any error that's not defined by the user. User defined errors:
```
{{ error_code_mapping_str }}
```{% endif %}
User details:
```
{{ navigation_payload_str }}
```
Current datetime in UTC, YYYY-MM-DD HH:MM format:
```
{{ utc_datetime }}
```

View File

@@ -0,0 +1,39 @@
Your are here to help the user to perform a CLICK action on the web page. Use the user instruction, the content of the elements parsed from the page, the screenshots of the page, and user details to determine which element to click.
Each actionable element is tagged with an ID. Only take the action on the elements provided in the HTML elements, do not image any new element.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"page_info": str, // Think step by step. Describe all the useful information in the page related to the user instruction.
"thoughts": str, // Think step by step. What information makes you believe which element to click. Use information you see on the site to explain.
"actions": array // You are supposed to give only one action("CLICK") in the action list. Here's the format of the action:
[{
"reasoning": str, // The reasoning behind the action. This reasoning must be user information agnostic. Mention why you chose the action type, and why you chose the element id. Keep the reasoning short and to the point.
"confidence_float": float, // The confidence of the action. Pick a number between 0.0 and 1.0. 0.0 means no confidence, 1.0 means full confidence
"action_type": str, // It's a string enum: "CLICK". "CLICK" is an element you'd like to click.
"id": str, // The id of the element to take action on. The id has to be one from the elements list.
"download": bool, // If true, the browser will trigger a download by clicking the element. If false, the browser will click the element without triggering a download.
}]
}
The URL of the page you're on right now is `{{ current_url }}`.
HTML elements from `{{ current_url }}`:
```
{{ elements }}
```
User instruction:
```
{{ navigation_goal }}
```
User details:
```
{{ navigation_payload_str }}
```
Current datetime in UTC, YYYY-MM-DD HH:MM format:
```
{{ utc_datetime }}
```

View File

@@ -0,0 +1,41 @@
Your are here to help the user to perform an INPUT_TEXT action on the web page. Use the user instruction, the content of the elements parsed from the page, the screenshots of the page, and user details to determine which element to input.
Each actionable element is tagged with an ID. Only take the action on the elements provided in the HTML elements, do not image any new element.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"page_info": str, // Think step by step. Describe all the useful information in the page related to the user instruction.
"thoughts": str, // Think step by step. What information makes you believe which element to input the value. Use information you see on the site to explain.
"actions": array // You are supposed to give only one action("INPUT_TEXT") in the action list. Here's the format of the action:
[{
"reasoning": str, // The reasoning behind the action. This reasoning must be user information agnostic. Mention why you chose the action type, and why you chose the element id. Keep the reasoning short and to the point.
"confidence_float": float, // The confidence of the action. Pick a number between 0.0 and 1.0. 0.0 means no confidence, 1.0 means full confidence
"action_type": str, // It's a string enum: "INPUT_TEXT". "INPUT_TEXT" is an element you'd like to input text into.
"id": str, // The id of the element to take action on. The id has to be one from the elements list.
"text": str, // The text to input.
}]{% if verification_code_check %}
"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 is needed to proceed. True only if the code is available to user. If the code is not sent, return false {% endif %}
}
The URL of the page you're on right now is `{{ current_url }}`.
HTML elements from `{{ current_url }}`:
```
{{ elements }}
```
User instruction:
```
{{ navigation_goal }}
```
User details:
```
{{ navigation_payload_str }}
```
Current datetime in UTC, YYYY-MM-DD HH:MM format:
```
{{ utc_datetime }}
```

View File

@@ -0,0 +1,43 @@
Your are here to help the user to perform an SELECT_OPTION action on the web page. Use the user instruction, the content of the elements parsed from the page, the screenshots of the page, and user details to determine which element to select.
Each actionable element is tagged with an ID. Only take the action on the elements provided in the HTML elements, do not image any new element.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"page_info": str, // Think step by step. Describe all the useful information in the page related to the user instruction.
"thoughts": str, // Think step by step. What information makes you believe which element to select. Use information you see on the site to explain.
"actions": array // You are supposed to give only one action("SELECT_OPTION") in the action list. Here's the format of the action:
[{
"reasoning": str, // The reasoning behind the action. This reasoning must be user information agnostic. Mention why you chose the action type, and why you chose the element id. Keep the reasoning short and to the point.
"confidence_float": float, // The confidence of the action. Pick a number between 0.0 and 1.0. 0.0 means no confidence, 1.0 means full confidence
"action_type": str, // It's a string enum: "SELECT_OPTION". "SELECT_OPTION" is an element you'd like to select an option from.
"id": str, // The id of the element to take action on. The id has to be one from the elements list.
"option": { // The option to select.
"label": str, // the label of the option if any. MAKE SURE YOU USE THIS LABEL TO SELECT THE OPTION. DO NOT PUT ANYTHING OTHER THAN A VALID OPTION LABEL HERE
"index": int, // the index corresponding to the option index under the select element.
"value": str // the value of the option. MAKE SURE YOU USE THIS VALUE TO SELECT THE OPTION. DO NOT PUT ANYTHING OTHER THAN A VALID OPTION VALUE HERE
},
}]
}
The URL of the page you're on right now is `{{ current_url }}`.
HTML elements from `{{ current_url }}`:
```
{{ elements }}
```
User instruction:
```
{{ navigation_goal }}
```
User details:
```
{{ navigation_payload_str }}
```
Current datetime in UTC, YYYY-MM-DD HH:MM format:
```
{{ utc_datetime }}
```

View File

@@ -0,0 +1,39 @@
Your are here to help the user to perform an UPLOAD_FILE action on the web page. Use the user instruction, the content of the elements parsed from the page, the screenshots of the page, and user details to determine which element to upload.
Each actionable element is tagged with an ID. Only take the action on the elements provided in the HTML elements, do not image any new element.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"page_info": str, // Think step by step. Describe all the useful information in the page related to the user instruction.
"thoughts": str, // Think step by step. What information makes you believe which element to upload the file. Use information you see on the site to explain.
"actions": array // You are supposed to give only one action("UPLOAD_FILE") in the action list. Here's the format of the action:
[{
"reasoning": str, // The reasoning behind the action. This reasoning must be user information agnostic. Mention why you chose the action type, and why you chose the element id. Keep the reasoning short and to the point.
"confidence_float": float, // The confidence of the action. Pick a number between 0.0 and 1.0. 0.0 means no confidence, 1.0 means full confidence
"action_type": str, // It's a string enum: "UPLOAD_FILE". "UPLOAD_FILE" is an element you'd like to upload a file into.
"id": str, // The id of the element to take action on. The id has to be one from the elements list.
"file_url": str, // The url of the file to upload.
}]
}
The URL of the page you're on right now is `{{ current_url }}`.
HTML elements from `{{ current_url }}`:
```
{{ elements }}
```
User instruction:
```
{{ navigation_goal }}
```
User details:
```
{{ navigation_payload_str }}
```
Current datetime in UTC, YYYY-MM-DD HH:MM format:
```
{{ utc_datetime }}
```