Skip to content

Commit e5bedb8

Browse files
feat: [fix]: add useSearch & toolTimeout to stainless types
1 parent 1de4c00 commit e5bedb8

4 files changed

Lines changed: 65 additions & 9 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

lib/stagehand/models/session_execute_params.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,28 @@ class ExecuteOptions < Stagehand::Internal::Type::BaseModel
198198
# @return [Float, nil]
199199
optional :max_steps, Float, api_name: :maxSteps
200200

201-
# @!method initialize(instruction:, highlight_cursor: nil, max_steps: nil)
201+
# @!attribute tool_timeout
202+
# Timeout in milliseconds for each agent tool call
203+
#
204+
# @return [Float, nil]
205+
optional :tool_timeout, Float, api_name: :toolTimeout
206+
207+
# @!attribute use_search
208+
# Whether to enable the web search tool powered by Browserbase Search API
209+
#
210+
# @return [Boolean, nil]
211+
optional :use_search, Stagehand::Internal::Type::Boolean, api_name: :useSearch
212+
213+
# @!method initialize(instruction:, highlight_cursor: nil, max_steps: nil, tool_timeout: nil, use_search: nil)
202214
# @param instruction [String] Natural language instruction for the agent
203215
#
204216
# @param highlight_cursor [Boolean] Whether to visually highlight the cursor during execution
205217
#
206218
# @param max_steps [Float] Maximum number of steps the agent can take
219+
#
220+
# @param tool_timeout [Float] Timeout in milliseconds for each agent tool call
221+
#
222+
# @param use_search [Boolean] Whether to enable the web search tool powered by Browserbase Search API
207223
end
208224

209225
# Whether to stream the response via SSE

rbi/stagehand/models/session_execute_params.rbi

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,27 @@ module Stagehand
387387
sig { params(max_steps: Float).void }
388388
attr_writer :max_steps
389389

390+
# Timeout in milliseconds for each agent tool call
391+
sig { returns(T.nilable(Float)) }
392+
attr_reader :tool_timeout
393+
394+
sig { params(tool_timeout: Float).void }
395+
attr_writer :tool_timeout
396+
397+
# Whether to enable the web search tool powered by Browserbase Search API
398+
sig { returns(T.nilable(T::Boolean)) }
399+
attr_reader :use_search
400+
401+
sig { params(use_search: T::Boolean).void }
402+
attr_writer :use_search
403+
390404
sig do
391405
params(
392406
instruction: String,
393407
highlight_cursor: T::Boolean,
394-
max_steps: Float
408+
max_steps: Float,
409+
tool_timeout: Float,
410+
use_search: T::Boolean
395411
).returns(T.attached_class)
396412
end
397413
def self.new(
@@ -400,7 +416,11 @@ module Stagehand
400416
# Whether to visually highlight the cursor during execution
401417
highlight_cursor: nil,
402418
# Maximum number of steps the agent can take
403-
max_steps: nil
419+
max_steps: nil,
420+
# Timeout in milliseconds for each agent tool call
421+
tool_timeout: nil,
422+
# Whether to enable the web search tool powered by Browserbase Search API
423+
use_search: nil
404424
)
405425
end
406426

@@ -409,7 +429,9 @@ module Stagehand
409429
{
410430
instruction: String,
411431
highlight_cursor: T::Boolean,
412-
max_steps: Float
432+
max_steps: Float,
433+
tool_timeout: Float,
434+
use_search: T::Boolean
413435
}
414436
)
415437
end

sig/stagehand/models/session_execute_params.rbs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ module Stagehand
158158
end
159159

160160
type execute_options =
161-
{ instruction: String, highlight_cursor: bool, max_steps: Float }
161+
{
162+
instruction: String,
163+
highlight_cursor: bool,
164+
max_steps: Float,
165+
tool_timeout: Float,
166+
use_search: bool
167+
}
162168

163169
class ExecuteOptions < Stagehand::Internal::Type::BaseModel
164170
attr_accessor instruction: String
@@ -171,16 +177,28 @@ module Stagehand
171177

172178
def max_steps=: (Float) -> Float
173179

180+
attr_reader tool_timeout: Float?
181+
182+
def tool_timeout=: (Float) -> Float
183+
184+
attr_reader use_search: bool?
185+
186+
def use_search=: (bool) -> bool
187+
174188
def initialize: (
175189
instruction: String,
176190
?highlight_cursor: bool,
177-
?max_steps: Float
191+
?max_steps: Float,
192+
?tool_timeout: Float,
193+
?use_search: bool
178194
) -> void
179195

180196
def to_hash: -> {
181197
instruction: String,
182198
highlight_cursor: bool,
183-
max_steps: Float
199+
max_steps: Float,
200+
tool_timeout: Float,
201+
use_search: bool
184202
}
185203
end
186204

0 commit comments

Comments
 (0)