Skip to content

Commit

Permalink
update user goal complete prompt to have more chain of thoughts (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored Oct 17, 2024
1 parent a239030 commit e56aae4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions skyvern/forge/prompts/skyvern/check-user-goal.j2
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
Based on the content of the elements on the page, determine whether the user goal has been successfully completed or not.
Your are here to help the user determine if the user has completed their goal on the web. Use the content of the elements parsed from the page, the user goal and user details to determine whether the user goal has been completed or not.

The JSON object should be in this format:
```json
{
"reasoning": str, // Describe the state of the user goal and explain why it has been completed or not completed.
"user_goal_achieved": bool // True if the user goal has been completed, False otherwise.
"state": str, // Describe the state of the page accoriding to the user goal. Be precise and talk about what progress the user made, and what the next step is to move towards the user goal if any.
"reasoning": str, // Be precise and explain whether the user goal has been completed and why do you think so. Use information you see on the site to explain.
"user_goal_achieved": bool // True if the user goal has been completed, false otherwise.
}

Make sure to ONLY return the JSON object, with no additional text before or after it. Do not make any assumptions, return a response solely based on the elements on the page.

Examples:
{
"reasoning": "There is a success message for a file upload field. Since the user's goal is to upload a file, it has been successfully completed.",
"state": "The page has a success message for a file upload field.",
"reasoning": "Since the user's goal is to upload a file, the success message indicates that the user goal has been successfully completed.",
"user_goal_achieved": true
}
{
"reasoning": "This is a job application form with fields. Since the user's goal is to submit a job application, it has not been successfully completed.",
"state": "The job application form is present. There are required fields or selections to be done. The submit button is there, indicating the form has not been submitted.",
"reasoning": "Since the user's goal is to submit a job application and the current form has not been submitted, the user goal has not been successfully completed.",
"user_goal_achieved": false
}

Expand All @@ -26,4 +29,4 @@ User Goal:
{{ navigation_goal }}

User Details:
{{ navigation_payload }}
{{ navigation_payload }}
2 changes: 1 addition & 1 deletion skyvern/forge/prompts/skyvern/extract-action.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Identify actions to help user progress towards the user goal using the DOM elements given in the list and the screenshot of the website.
Include only the elements that are relevant to the user goal, without altering or imagining new elements.
Accurately interpret and understand the functional significance of SVG elements based on their shapes and context within the webpage.
Use the details from the user details to fill in necessary values. Always satisfy required fields if the field isn't already filled in. Don't return any action for the same field, if this field is already filled in and the value is the same as the one you would have filled in.
Use the user details to fill in necessary values. Always satisfy required fields if the field isn't already filled in. Don't return any action for the same field, if this field is already filled in and the value is the same as the one you would have filled in.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Each interactable element is tagged with an ID.
If you see any information in red in the page screenshot, this means a condition wasn't satisfied. prioritize actions with the red information.
Expand Down

0 comments on commit e56aae4

Please sign in to comment.