| 57 | return decorator |
| 58 | @dataclass |
| 59 | class WebObservation: |
| 60 | content: str # text content of the page |
| 61 | url: str # URL of the page |
| 62 | screenshot: str # base64-encoded screenshot, png |
| 63 | open_pages_urls: list[str] # list of open pages |
| 64 | active_page_index: int # index of the active page |
| 65 | dom_object: dict # DOM object |
| 66 | axtree_object: dict # accessibility tree object |
| 67 | extra_element_properties: dict |
| 68 | focused_element_bid: str # focused element bid |
| 69 | last_browser_action: str # last browser env action performed |
| 70 | last_browser_action_error: str # last browser env action error |
| 71 | error: bool # error flag |
| 72 | |
| 73 | def to_web_obs(obs) -> WebObservation: |
| 74 | obs_dict = dict( |