MCPcopy Create free account
hub / github.com/SkyworkAI/DeepResearchAgent / SerializedDOMState

Class SerializedDOMState

src/environment/browser/dom/views.py:800–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798
799@dataclass
800class SerializedDOMState:
801 _root: SimplifiedNode | None
802 """Not meant to be used directly, use `llm_representation` instead"""
803
804 selector_map: DOMSelectorMap
805
806 @observe_debug(ignore_input=True, ignore_output=True, name='llm_representation')
807 def llm_representation(
808 self,
809 include_attributes: list[str] | None = None,
810 ) -> str:
811 """Kinda ugly, but leaving this as an internal method because include_attributes are a parameter on the agent, so we need to leave it as a 2 step process"""
812 from src.environment.browser.dom.serializer.serializer import DOMTreeSerializer
813
814 if not self._root:
815 return 'Empty DOM tree (you might have to wait for the page to load)'
816
817 include_attributes = include_attributes or DEFAULT_INCLUDE_ATTRIBUTES
818
819 return DOMTreeSerializer.serialize_tree(self._root, include_attributes)
820
821
822@dataclass

Calls

no outgoing calls

Tested by

no test coverage detected