diff --git a/skyvern/forge/prompts/skyvern/extract-action-claude3-sonnet.j2 b/skyvern/forge/prompts/skyvern/extract-action-claude3-sonnet.j2 index c74c5a21..1b133347 100644 --- a/skyvern/forge/prompts/skyvern/extract-action-claude3-sonnet.j2 +++ b/skyvern/forge/prompts/skyvern/extract-action-claude3-sonnet.j2 @@ -2,7 +2,7 @@ Identify actions to help user progress towards the user goal using the DOM eleme Include only the elements that are relevant to the user goal, without altering or imagining new elements. 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. MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc. -Each element is tagged with an ID and interactable value. You should only return actions on the interactable elements. +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. If you see a popup in the page screenshot, prioritize actions on the popup. diff --git a/skyvern/forge/prompts/skyvern/extract-action.j2 b/skyvern/forge/prompts/skyvern/extract-action.j2 index eb088d0b..53619cbd 100644 --- a/skyvern/forge/prompts/skyvern/extract-action.j2 +++ b/skyvern/forge/prompts/skyvern/extract-action.j2 @@ -2,7 +2,7 @@ Identify actions to help user progress towards the user goal using the DOM eleme Include only the elements that are relevant to the user goal, without altering or imagining new elements. 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. MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc. -Each element is tagged with an ID and interactable value. You should only return actions on the interactable elements. +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. If you see a popup in the page screenshot, prioritize actions on the popup. diff --git a/skyvern/webeye/scraper/scraper.py b/skyvern/webeye/scraper/scraper.py index 1166682c..ec734e15 100644 --- a/skyvern/webeye/scraper/scraper.py +++ b/skyvern/webeye/scraper/scraper.py @@ -46,7 +46,6 @@ RESERVED_ATTRIBUTES = { ELEMENT_NODE_ATTRIBUTES = { "id", - "interactable", } @@ -425,6 +424,9 @@ def trim_element_tree(elements: list[dict]) -> list[dict]: if "frame" in queue_ele: del queue_ele["frame"] + if not queue_ele.get("interactable"): + del queue_ele["id"] + if "attributes" in queue_ele: tag_name = queue_ele["tagName"] if "tagName" in queue_ele else "" new_attributes = _trimmed_attributes(tag_name, queue_ele["attributes"])