Skip to content

Commit a1094cd

Browse files
feat: [fix]: add useSearch & toolTimeout to stainless types
1 parent 01a9b0c commit a1094cd

3 files changed

Lines changed: 48 additions & 4 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%2Fstagehand-573d364768ac1902ee5ed8b2485d3b293bda0ea8ff7898aef1a3fd6be79b594a.yml
3-
openapi_spec_hash: 107ec840f4330885dd2232a05a66fed7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-4112eba8679ed34cc7c0e4b28ee3f1569cf47d6e4a8252c28b5ef2ee02a82b8c.yml
3+
openapi_spec_hash: b46202361a71845a51d26e880a444d0b
44
config_hash: 0209737a4ab2a71afececb0ff7459998

src/Sessions/SessionExecuteParams/ExecuteOptions.php

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111

1212
/**
1313
* @phpstan-type ExecuteOptionsShape = array{
14-
* instruction: string, highlightCursor?: bool|null, maxSteps?: float|null
14+
* instruction: string,
15+
* highlightCursor?: bool|null,
16+
* maxSteps?: float|null,
17+
* toolTimeout?: float|null,
18+
* useSearch?: bool|null,
1519
* }
1620
*/
1721
final class ExecuteOptions implements BaseModel
@@ -37,6 +41,18 @@ final class ExecuteOptions implements BaseModel
3741
#[Optional]
3842
public ?float $maxSteps;
3943

44+
/**
45+
* Timeout in milliseconds for each agent tool call.
46+
*/
47+
#[Optional]
48+
public ?float $toolTimeout;
49+
50+
/**
51+
* Whether to enable the web search tool powered by Browserbase Search API.
52+
*/
53+
#[Optional]
54+
public ?bool $useSearch;
55+
4056
/**
4157
* `new ExecuteOptions()` is missing required properties by the API.
4258
*
@@ -64,14 +80,18 @@ public function __construct()
6480
public static function with(
6581
string $instruction,
6682
?bool $highlightCursor = null,
67-
?float $maxSteps = null
83+
?float $maxSteps = null,
84+
?float $toolTimeout = null,
85+
?bool $useSearch = null,
6886
): self {
6987
$self = new self;
7088

7189
$self['instruction'] = $instruction;
7290

7391
null !== $highlightCursor && $self['highlightCursor'] = $highlightCursor;
7492
null !== $maxSteps && $self['maxSteps'] = $maxSteps;
93+
null !== $toolTimeout && $self['toolTimeout'] = $toolTimeout;
94+
null !== $useSearch && $self['useSearch'] = $useSearch;
7595

7696
return $self;
7797
}
@@ -108,4 +128,26 @@ public function withMaxSteps(float $maxSteps): self
108128

109129
return $self;
110130
}
131+
132+
/**
133+
* Timeout in milliseconds for each agent tool call.
134+
*/
135+
public function withToolTimeout(float $toolTimeout): self
136+
{
137+
$self = clone $this;
138+
$self['toolTimeout'] = $toolTimeout;
139+
140+
return $self;
141+
}
142+
143+
/**
144+
* Whether to enable the web search tool powered by Browserbase Search API.
145+
*/
146+
public function withUseSearch(bool $useSearch): self
147+
{
148+
$self = clone $this;
149+
$self['useSearch'] = $useSearch;
150+
151+
return $self;
152+
}
111153
}

tests/Services/SessionsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ public function testExecuteWithOptionalParams(): void
149149
'instruction' => 'Log in with username \'demo\' and password \'test123\', then navigate to settings',
150150
'highlightCursor' => true,
151151
'maxSteps' => 20,
152+
'toolTimeout' => 30000,
153+
'useSearch' => true,
152154
],
153155
frameID: 'frameId',
154156
shouldCache: true,

0 commit comments

Comments
 (0)