Extracting Sidebars
Extract sidebar structure from your application
You can use the agent to extract structured sidebar information from your application UI. This is useful for validating navigation, generating documentation, or automating UI tests.
To do this, define a response schema that models the sidebar structure as a recursive tree. For example:
This schema is recursive because each SidebarItem
can contain a list of more SidebarItem
objects as its children, forming a tree structure.
Then, use the agent to extract the sidebar below a specific section, such as “Introduction”:
Example
Suppose you have the following sidebar in your application:
The extracted output would look like:
This approach allows you to retrieve the sidebar as a structured JSON object, representing a recursive tree, making it easy to inspect or use in further automation.
Tip:
Adjust the schema to match your sidebar’s recursive tree structure, and use clear instructions to get accurate results.