Remove id for noninteractable and interactable attr in prompt (#430)

This commit is contained in:
LawyZheng
2024-06-13 10:14:21 +08:00
committed by GitHub
parent bce6b6ae32
commit 420eef18dd
3 changed files with 5 additions and 3 deletions

View File

@@ -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"])