Skip to main content

Observe

See how to use observe() to discover actionable elements and analyze web page structure

Method Signatures

ObserveOptions Interface:

Parameters

instruction
string
Natural language description of elements or actions to discover.
modelName
AvailableModel
Override the default LLM model for this observation.
modelClientOptions
ClientOptions
Model-specific configuration options.
domSettleTimeoutMs
number
Maximum time to wait for DOM to stabilize before analysis.Default: 30000
drawOverlay
boolean
Whether to draw visual overlays on discovered elements (debugging).Default: false
iframes
boolean
Set to true to search within iframes.Default: false

Response

Returns: Promise<ObserveResult[]> Array of discovered actionable elements, ordered by relevance. ObserveResult Interface:
selector
string
XPath selector that precisely locates the element.
description
string
Human-readable description of the element and its purpose.
method
string
Suggested interaction method: "click", "fill", "selectOptionFromDropdown", "nextChunk", "scrollTo", "prevChunk".
arguments
string[]
Additional parameters for the suggested action.

Code Examples

Integration Patterns