Skip to content

Commit 501d30b

Browse files
feat: [feat]: add ignoreSelectors to observe()
1 parent 13699f2 commit 501d30b

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-49b40c7425adba9e67fc102838c5216c45ca1f7ef4c10823c5665fd413538504.yml
3-
openapi_spec_hash: 6880dc029df2e88dfe8943c0dec5a3a5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-eae8400fade7b2c8329c4148f56de92e147c34c0feecb420c015aab6544a9acc.yml
3+
openapi_spec_hash: 0a9eff1ac1d464e89cbd9db64709b08a
44
config_hash: 1fb12ae9b478488bc1e56bfbdc210b01

session.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,8 @@ type SessionObserveParamsOptions struct {
15341534
Selector param.Opt[string] `json:"selector,omitzero"`
15351535
// Timeout in ms for the observation
15361536
Timeout param.Opt[float64] `json:"timeout,omitzero"`
1537+
// Selectors for elements and subtrees that should be excluded from observation
1538+
IgnoreSelectors []string `json:"ignoreSelectors,omitzero"`
15371539
// Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
15381540
Model SessionObserveParamsOptionsModelUnion `json:"model,omitzero"`
15391541
// Variables whose names are exposed to the model so observe() returns

session_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ func TestSessionObserveWithOptionalParams(t *testing.T) {
292292
FrameID: stagehand.String("frameId"),
293293
Instruction: stagehand.String("Find all clickable navigation links"),
294294
Options: stagehand.SessionObserveParamsOptions{
295+
IgnoreSelectors: []string{"nav", ".cookie-banner", "#sidebar-ads"},
295296
Model: stagehand.SessionObserveParamsOptionsModelUnion{
296297
OfModelConfig: &stagehand.ModelConfigParam{
297298
ModelName: "openai/gpt-5.4-mini",

0 commit comments

Comments
 (0)