Skip to content

Commit 872590f

Browse files
feat: [feat]: add ignoreSelectors to observe()
1 parent 8cdd2ac commit 872590f

2 files changed

Lines changed: 27 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

src/Sessions/SessionObserveParams/Options.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* @phpstan-import-type VariableShape from \Stagehand\Sessions\SessionObserveParams\Options\Variable
1818
*
1919
* @phpstan-type OptionsShape = array{
20+
* ignoreSelectors?: list<string>|null,
2021
* model?: ModelShape|null,
2122
* selector?: string|null,
2223
* timeout?: float|null,
@@ -28,6 +29,14 @@ final class Options implements BaseModel
2829
/** @use SdkModel<OptionsShape> */
2930
use SdkModel;
3031

32+
/**
33+
* Selectors for elements and subtrees that should be excluded from observation.
34+
*
35+
* @var list<string>|null $ignoreSelectors
36+
*/
37+
#[Optional(list: 'string')]
38+
public ?array $ignoreSelectors;
39+
3140
/**
3241
* Model configuration object or model name string (e.g., 'openai/gpt-5-nano').
3342
*
@@ -66,17 +75,20 @@ public function __construct()
6675
*
6776
* You must use named parameters to construct any parameters with a default value.
6877
*
78+
* @param list<string>|null $ignoreSelectors
6979
* @param ModelShape|null $model
7080
* @param array<string,VariableShape>|null $variables
7181
*/
7282
public static function with(
83+
?array $ignoreSelectors = null,
7384
string|ModelConfig|array|null $model = null,
7485
?string $selector = null,
7586
?float $timeout = null,
7687
?array $variables = null,
7788
): self {
7889
$self = new self;
7990

91+
null !== $ignoreSelectors && $self['ignoreSelectors'] = $ignoreSelectors;
8092
null !== $model && $self['model'] = $model;
8193
null !== $selector && $self['selector'] = $selector;
8294
null !== $timeout && $self['timeout'] = $timeout;
@@ -85,6 +97,19 @@ public static function with(
8597
return $self;
8698
}
8799

100+
/**
101+
* Selectors for elements and subtrees that should be excluded from observation.
102+
*
103+
* @param list<string> $ignoreSelectors
104+
*/
105+
public function withIgnoreSelectors(array $ignoreSelectors): self
106+
{
107+
$self = clone $this;
108+
$self['ignoreSelectors'] = $ignoreSelectors;
109+
110+
return $self;
111+
}
112+
88113
/**
89114
* Model configuration object or model name string (e.g., 'openai/gpt-5-nano').
90115
*

0 commit comments

Comments
 (0)