From 310b11365a58f839917b7521ef1a4851b59a8d39 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Tue, 7 Jan 2025 18:22:42 -0800 Subject: [PATCH] chain of thought for user goal extraction and goal completion in observer (#1513) --- skyvern/forge/prompts/skyvern/observer.j2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skyvern/forge/prompts/skyvern/observer.j2 b/skyvern/forge/prompts/skyvern/observer.j2 index 89011290..f895681e 100644 --- a/skyvern/forge/prompts/skyvern/observer.j2 +++ b/skyvern/forge/prompts/skyvern/observer.j2 @@ -13,7 +13,10 @@ 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 goal. "thoughts": str, // Think step by step. What has been done so far and what is the next reasonable mini goal a human can do foreseeably move towards the overall goal. - "user_goal_achieved": bool, // True if the user goal has been completed, false otherwise. If the user is searching for something, looking for information or specifically trying to extract information along side the goal, make sure at least an extract task has happened in the task history before claiming that the goal is achieved. + "extraction_thought": str, // Think step by step. Should any information be extracted given the user goal? If yes, has all the information been extracted? If the user is searching for something, looking for information or specifically trying to extract information along side the goal, consider it an intention to extract information. Phrases like "find something", "show me something", "search something" and so on indicate the intention to extract information. + "require_extraction": bool, // True if the user goal requires information extraction. False otherwise. + "information_extracted": optional[bool], // True if the needed information has been extracted. False if the needed information has not been extracted. Null if the user goal does not require information extraction. + "user_goal_achieved": bool, // True if the user goal has been completed, false otherwise. If the user wants to extract information and it has not been done, the user goal is not achieved. "plan": str, // The mini goal to achieve to move towards the user goal. DO NOT come up or hallucinate any data that's not provided in the user goal. Be accurate and precise. Return null if the user goal has been achieved. "task_type": str, // One of the available task types: navigate, extract, loop "loop_values": list[str], // a list of string values to iterate through for loop task. null if it's not a loop task