This commit is contained in:
Yao Liu
2025-01-22 11:32:35 -08:00
parent dac181a456
commit 4b8dbfd9c5
298 changed files with 56437 additions and 9 deletions

View File

@@ -0,0 +1,3 @@
from .html_prompt import prompts
from .config import basic_attrs, mind2web_keep_attrs, miniwob_attrs
from .config import config_meta

View File

@@ -0,0 +1,49 @@
basic_attrs = [
'title',
'value',
'placeholder',
'selected',
]
mind2web_keep_attrs = [
'alt',
'aria_description',
'aria_label',
'aria_role',
'input_checked',
'input_value',
'label',
'name',
'option_selected',
'placeholder',
'role',
'text_value',
'title',
'type',
'value',
]
miniwob_attrs = [
'id',
'type',
'value',
]
config_meta = """
======= Configs =======
Columns:
- id: {id_attr}
- label: {label_attr}
Position: {use_position}
- window: {window_size}
- rect_dict: {rect}
Keep:
- parents: {parent_chain}
- attrs: {keep_attrs}
- elems: {keep_elem}
- obs_elem: {obs_elem}
Generator:
- prompt: {prompt_name}
- label: {identifier_name}
========================
"""

View File

@@ -0,0 +1,22 @@
refine_prompt = {
'dom': '<{tag}{label}|{attr}{content}{subtree} >',
'label': '[{label}]',
'attr': '{attr}',
'attr_splitter': '; ',
'subtree_splitter': ' ',
}
xml_prompt = {
'dom': '<{tag}{label}{attr}>{content}{subtree} </{tag}>',
'label': ' id="{label}"',
'attr': '{key}="{attr}"',
'attr_splitter': ' ',
'subtree_splitter': ' ',
}
prompts = {
'refine': refine_prompt,
'xml': xml_prompt,
'new_data': refine_prompt,
}