Skip to content

Commit 0619302

Browse files
feat(api): manual updates
1 parent a41c8c5 commit 0619302

27 files changed

Lines changed: 775 additions & 115 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-f7d6b6489159f611a2bfdc267ce0a6fc0455bed1ffa0c310044baaa5d8381b9b.yml
3-
openapi_spec_hash: cd88d8068abfde8382da0bed674e440c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-4fb17cafc413ae3d575e3268602b01d2d0e9ebeb734a41b6086b3353ff0d2523.yml
3+
openapi_spec_hash: 8d48d8564849246f6f14d900c6c5f60c
44
config_hash: 5c69fb596588b8ace08203858518c149

lib/stagehand/models/action.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ class Action < Stagehand::Internal::Type::BaseModel
2121
# @return [Array<String>, nil]
2222
optional :arguments, Stagehand::Internal::Type::ArrayOf[String]
2323

24+
# @!attribute backend_node_id
25+
# Backend node ID for the element
26+
#
27+
# @return [Float, nil]
28+
optional :backend_node_id, Float, api_name: :backendNodeId
29+
2430
# @!attribute method_
2531
# The method to execute (click, fill, etc.)
2632
#
2733
# @return [String, nil]
2834
optional :method_, String, api_name: :method
2935

30-
# @!method initialize(description:, selector:, arguments: nil, method_: nil)
36+
# @!method initialize(description:, selector:, arguments: nil, backend_node_id: nil, method_: nil)
3137
# Action object returned by observe and used by act
3238
#
3339
# @param description [String] Human-readable description of the action
@@ -36,6 +42,8 @@ class Action < Stagehand::Internal::Type::BaseModel
3642
#
3743
# @param arguments [Array<String>] Arguments to pass to the method
3844
#
45+
# @param backend_node_id [Float] Backend node ID for the element
46+
#
3947
# @param method_ [String] The method to execute (click, fill, etc.)
4048
end
4149
end

lib/stagehand/models/model_config.rb

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,35 @@ class ModelConfigObject < Stagehand::Internal::Type::BaseModel
3131
# @return [String, nil]
3232
optional :base_url, String, api_name: :baseURL
3333

34-
# @!method initialize(model_name:, api_key: nil, base_url: nil)
34+
# @!attribute provider
35+
# AI provider for the model (or provide a baseURL endpoint instead)
36+
#
37+
# @return [Symbol, Stagehand::Models::ModelConfig::ModelConfigObject::Provider, nil]
38+
optional :provider, enum: -> { Stagehand::ModelConfig::ModelConfigObject::Provider }
39+
40+
# @!method initialize(model_name:, api_key: nil, base_url: nil, provider: nil)
3541
# @param model_name [String] Model name string without prefix (e.g., 'gpt-5-nano', 'claude-4.5-opus')
3642
#
3743
# @param api_key [String] API key for the model provider
3844
#
3945
# @param base_url [String] Base URL for the model provider
46+
#
47+
# @param provider [Symbol, Stagehand::Models::ModelConfig::ModelConfigObject::Provider] AI provider for the model (or provide a baseURL endpoint instead)
48+
49+
# AI provider for the model (or provide a baseURL endpoint instead)
50+
#
51+
# @see Stagehand::Models::ModelConfig::ModelConfigObject#provider
52+
module Provider
53+
extend Stagehand::Internal::Type::Enum
54+
55+
OPENAI = :openai
56+
ANTHROPIC = :anthropic
57+
GOOGLE = :google
58+
MICROSOFT = :microsoft
59+
60+
# @!method self.values
61+
# @return [Array<Symbol>]
62+
end
4063
end
4164

4265
# @!method self.variants

lib/stagehand/models/session_act_response.rb

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ class Result < Stagehand::Internal::Type::BaseModel
5151
# @!attribute actions
5252
# List of actions that were executed
5353
#
54-
# @return [Array<Stagehand::Models::Action>]
55-
required :actions, -> { Stagehand::Internal::Type::ArrayOf[Stagehand::Action] }
54+
# @return [Array<Stagehand::Models::SessionActResponse::Data::Result::Action>]
55+
required :actions,
56+
-> { Stagehand::Internal::Type::ArrayOf[Stagehand::Models::SessionActResponse::Data::Result::Action] }
5657

5758
# @!attribute message
5859
# Human-readable result message
@@ -69,11 +70,56 @@ class Result < Stagehand::Internal::Type::BaseModel
6970
# @!method initialize(action_description:, actions:, message:, success:)
7071
# @param action_description [String] Description of the action that was performed
7172
#
72-
# @param actions [Array<Stagehand::Models::Action>] List of actions that were executed
73+
# @param actions [Array<Stagehand::Models::SessionActResponse::Data::Result::Action>] List of actions that were executed
7374
#
7475
# @param message [String] Human-readable result message
7576
#
7677
# @param success [Boolean] Whether the action completed successfully
78+
79+
class Action < Stagehand::Internal::Type::BaseModel
80+
# @!attribute description
81+
# Human-readable description of the action
82+
#
83+
# @return [String]
84+
required :description, String
85+
86+
# @!attribute selector
87+
# CSS selector or XPath for the element
88+
#
89+
# @return [String]
90+
required :selector, String
91+
92+
# @!attribute arguments
93+
# Arguments to pass to the method
94+
#
95+
# @return [Array<String>, nil]
96+
optional :arguments, Stagehand::Internal::Type::ArrayOf[String]
97+
98+
# @!attribute backend_node_id
99+
# Backend node ID for the element
100+
#
101+
# @return [Float, nil]
102+
optional :backend_node_id, Float, api_name: :backendNodeId
103+
104+
# @!attribute method_
105+
# The method to execute (click, fill, etc.)
106+
#
107+
# @return [String, nil]
108+
optional :method_, String, api_name: :method
109+
110+
# @!method initialize(description:, selector:, arguments: nil, backend_node_id: nil, method_: nil)
111+
# Action object returned by observe and used by act
112+
#
113+
# @param description [String] Human-readable description of the action
114+
#
115+
# @param selector [String] CSS selector or XPath for the element
116+
#
117+
# @param arguments [Array<String>] Arguments to pass to the method
118+
#
119+
# @param backend_node_id [Float] Backend node ID for the element
120+
#
121+
# @param method_ [String] The method to execute (click, fill, etc.)
122+
end
77123
end
78124
end
79125
end

lib/stagehand/models/session_execute_params.rb

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,44 @@ class AgentConfig < Stagehand::Internal::Type::BaseModel
8282
# @return [String, Stagehand::Models::ModelConfig::ModelConfigObject, nil]
8383
optional :model, union: -> { Stagehand::ModelConfig }
8484

85+
# @!attribute provider
86+
# AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)
87+
#
88+
# @return [Symbol, Stagehand::Models::SessionExecuteParams::AgentConfig::Provider, nil]
89+
optional :provider, enum: -> { Stagehand::SessionExecuteParams::AgentConfig::Provider }
90+
8591
# @!attribute system_prompt
8692
# Custom system prompt for the agent
8793
#
8894
# @return [String, nil]
8995
optional :system_prompt, String, api_name: :systemPrompt
9096

91-
# @!method initialize(cua: nil, model: nil, system_prompt: nil)
97+
# @!method initialize(cua: nil, model: nil, provider: nil, system_prompt: nil)
9298
# Some parameter documentations has been truncated, see
9399
# {Stagehand::Models::SessionExecuteParams::AgentConfig} for more details.
94100
#
95101
# @param cua [Boolean] Enable Computer Use Agent mode
96102
#
97103
# @param model [String, Stagehand::Models::ModelConfig::ModelConfigObject] Model name string with provider prefix (e.g., 'openai/gpt-5-nano', 'anthropic/cl
98104
#
105+
# @param provider [Symbol, Stagehand::Models::SessionExecuteParams::AgentConfig::Provider] AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)
106+
#
99107
# @param system_prompt [String] Custom system prompt for the agent
108+
109+
# AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)
110+
#
111+
# @see Stagehand::Models::SessionExecuteParams::AgentConfig#provider
112+
module Provider
113+
extend Stagehand::Internal::Type::Enum
114+
115+
OPENAI = :openai
116+
ANTHROPIC = :anthropic
117+
GOOGLE = :google
118+
MICROSOFT = :microsoft
119+
120+
# @!method self.values
121+
# @return [Array<Symbol>]
122+
end
100123
end
101124

102125
class ExecuteOptions < Stagehand::Internal::Type::BaseModel

lib/stagehand/models/session_observe_response.rb

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ class SessionObserveResponse < Stagehand::Internal::Type::BaseModel
2626
class Data < Stagehand::Internal::Type::BaseModel
2727
# @!attribute result
2828
#
29-
# @return [Array<Stagehand::Models::Action>]
30-
required :result, -> { Stagehand::Internal::Type::ArrayOf[Stagehand::Action] }
29+
# @return [Array<Stagehand::Models::SessionObserveResponse::Data::Result>]
30+
required :result,
31+
-> { Stagehand::Internal::Type::ArrayOf[Stagehand::Models::SessionObserveResponse::Data::Result] }
3132

3233
# @!attribute action_id
3334
# Action ID for tracking
@@ -36,9 +37,54 @@ class Data < Stagehand::Internal::Type::BaseModel
3637
optional :action_id, String, api_name: :actionId
3738

3839
# @!method initialize(result:, action_id: nil)
39-
# @param result [Array<Stagehand::Models::Action>]
40+
# @param result [Array<Stagehand::Models::SessionObserveResponse::Data::Result>]
4041
#
4142
# @param action_id [String] Action ID for tracking
43+
44+
class Result < Stagehand::Internal::Type::BaseModel
45+
# @!attribute description
46+
# Human-readable description of the action
47+
#
48+
# @return [String]
49+
required :description, String
50+
51+
# @!attribute selector
52+
# CSS selector or XPath for the element
53+
#
54+
# @return [String]
55+
required :selector, String
56+
57+
# @!attribute arguments
58+
# Arguments to pass to the method
59+
#
60+
# @return [Array<String>, nil]
61+
optional :arguments, Stagehand::Internal::Type::ArrayOf[String]
62+
63+
# @!attribute backend_node_id
64+
# Backend node ID for the element
65+
#
66+
# @return [Float, nil]
67+
optional :backend_node_id, Float, api_name: :backendNodeId
68+
69+
# @!attribute method_
70+
# The method to execute (click, fill, etc.)
71+
#
72+
# @return [String, nil]
73+
optional :method_, String, api_name: :method
74+
75+
# @!method initialize(description:, selector:, arguments: nil, backend_node_id: nil, method_: nil)
76+
# Action object returned by observe and used by act
77+
#
78+
# @param description [String] Human-readable description of the action
79+
#
80+
# @param selector [String] CSS selector or XPath for the element
81+
#
82+
# @param arguments [Array<String>] Arguments to pass to the method
83+
#
84+
# @param backend_node_id [Float] Backend node ID for the element
85+
#
86+
# @param method_ [String] The method to execute (click, fill, etc.)
87+
end
4288
end
4389
end
4490
end

lib/stagehand/models/session_start_params.rb

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SessionStartParams < Stagehand::Internal::Type::BaseModel
1414
required :model_name, String, api_name: :modelName
1515

1616
# @!attribute act_timeout_ms
17-
# Timeout in ms for act operations
17+
# Timeout in ms for act operations (deprecated, v2 only)
1818
#
1919
# @return [Float, nil]
2020
optional :act_timeout_ms, Float, api_name: :actTimeoutMs
@@ -37,11 +37,6 @@ class SessionStartParams < Stagehand::Internal::Type::BaseModel
3737
# @return [String, nil]
3838
optional :browserbase_session_id, String, api_name: :browserbaseSessionID
3939

40-
# @!attribute debug_dom
41-
#
42-
# @return [Boolean, nil]
43-
optional :debug_dom, Stagehand::Internal::Type::Boolean, api_name: :debugDom
44-
4540
# @!attribute dom_settle_timeout_ms
4641
# Timeout in ms to wait for DOM to settle
4742
#
@@ -68,10 +63,11 @@ class SessionStartParams < Stagehand::Internal::Type::BaseModel
6863
# @!attribute verbose
6964
# Logging verbosity level (0=quiet, 1=normal, 2=debug)
7065
#
71-
# @return [Integer, nil]
72-
optional :verbose, Integer
66+
# @return [Symbol, Stagehand::Models::SessionStartParams::Verbose, nil]
67+
optional :verbose, enum: -> { Stagehand::SessionStartParams::Verbose }
7368

7469
# @!attribute wait_for_captcha_solves
70+
# Wait for captcha solves (deprecated, v2 only)
7571
#
7672
# @return [Boolean, nil]
7773
optional :wait_for_captcha_solves, Stagehand::Internal::Type::Boolean, api_name: :waitForCaptchaSolves
@@ -100,19 +96,17 @@ class SessionStartParams < Stagehand::Internal::Type::BaseModel
10096
# @return [Symbol, Stagehand::Models::SessionStartParams::XStreamResponse, nil]
10197
optional :x_stream_response, enum: -> { Stagehand::SessionStartParams::XStreamResponse }
10298

103-
# @!method initialize(model_name:, act_timeout_ms: nil, browser: nil, browserbase_session_create_params: nil, browserbase_session_id: nil, debug_dom: nil, dom_settle_timeout_ms: nil, experimental: nil, self_heal: nil, system_prompt: nil, verbose: nil, wait_for_captcha_solves: nil, x_language: nil, x_sdk_version: nil, x_sent_at: nil, x_stream_response: nil, request_options: {})
99+
# @!method initialize(model_name:, act_timeout_ms: nil, browser: nil, browserbase_session_create_params: nil, browserbase_session_id: nil, dom_settle_timeout_ms: nil, experimental: nil, self_heal: nil, system_prompt: nil, verbose: nil, wait_for_captcha_solves: nil, x_language: nil, x_sdk_version: nil, x_sent_at: nil, x_stream_response: nil, request_options: {})
104100
# @param model_name [String] Model name to use for AI operations
105101
#
106-
# @param act_timeout_ms [Float] Timeout in ms for act operations
102+
# @param act_timeout_ms [Float] Timeout in ms for act operations (deprecated, v2 only)
107103
#
108104
# @param browser [Stagehand::Models::SessionStartParams::Browser]
109105
#
110106
# @param browserbase_session_create_params [Stagehand::Models::SessionStartParams::BrowserbaseSessionCreateParams]
111107
#
112108
# @param browserbase_session_id [String] Existing Browserbase session ID to resume
113109
#
114-
# @param debug_dom [Boolean]
115-
#
116110
# @param dom_settle_timeout_ms [Float] Timeout in ms to wait for DOM to settle
117111
#
118112
# @param experimental [Boolean]
@@ -121,9 +115,9 @@ class SessionStartParams < Stagehand::Internal::Type::BaseModel
121115
#
122116
# @param system_prompt [String] Custom system prompt for AI operations
123117
#
124-
# @param verbose [Integer] Logging verbosity level (0=quiet, 1=normal, 2=debug)
118+
# @param verbose [Symbol, Stagehand::Models::SessionStartParams::Verbose] Logging verbosity level (0=quiet, 1=normal, 2=debug)
125119
#
126-
# @param wait_for_captcha_solves [Boolean]
120+
# @param wait_for_captcha_solves [Boolean] Wait for captcha solves (deprecated, v2 only)
127121
#
128122
# @param x_language [Symbol, Stagehand::Models::SessionStartParams::XLanguage] Client SDK language
129123
#
@@ -759,6 +753,18 @@ module Region
759753
end
760754
end
761755

756+
# Logging verbosity level (0=quiet, 1=normal, 2=debug)
757+
module Verbose
758+
extend Stagehand::Internal::Type::Enum
759+
760+
VERBOSE_0 = :"0"
761+
VERBOSE_1 = :"1"
762+
VERBOSE_2 = :"2"
763+
764+
# @!method self.values
765+
# @return [Array<Symbol>]
766+
end
767+
762768
# Client SDK language
763769
module XLanguage
764770
extend Stagehand::Internal::Type::Enum

lib/stagehand/models/session_start_response.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,28 @@ class Data < Stagehand::Internal::Type::BaseModel
2727
# @return [Boolean]
2828
required :available, Stagehand::Internal::Type::Boolean
2929

30-
# @!attribute connect_url
31-
# CDP WebSocket URL for connecting to the Browserbase cloud browser
32-
#
33-
# @return [String]
34-
required :connect_url, String, api_name: :connectUrl
35-
3630
# @!attribute session_id
3731
# Unique Browserbase session identifier
3832
#
3933
# @return [String]
4034
required :session_id, String, api_name: :sessionId
4135

42-
# @!method initialize(available:, connect_url:, session_id:)
43-
# @param available [Boolean]
36+
# @!attribute cdp_url
37+
# CDP WebSocket URL for connecting to the Browserbase cloud browser (present when
38+
# available)
4439
#
45-
# @param connect_url [String] CDP WebSocket URL for connecting to the Browserbase cloud browser
40+
# @return [String, nil]
41+
optional :cdp_url, String, api_name: :cdpUrl, nil?: true
42+
43+
# @!method initialize(available:, session_id:, cdp_url: nil)
44+
# Some parameter documentations has been truncated, see
45+
# {Stagehand::Models::SessionStartResponse::Data} for more details.
46+
#
47+
# @param available [Boolean]
4648
#
4749
# @param session_id [String] Unique Browserbase session identifier
50+
#
51+
# @param cdp_url [String, nil] CDP WebSocket URL for connecting to the Browserbase cloud browser (present when
4852
end
4953
end
5054
end

lib/stagehand/models/stream_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class StreamEvent < Stagehand::Internal::Type::BaseModel
2222

2323
# @!method initialize(id:, data:, type:)
2424
# Server-Sent Event emitted during streaming responses. Events are sent as
25-
# `data: <JSON>\n\n`.
25+
# `data: <JSON>\n\n`. Key order: data (with status first), type, id.
2626
#
2727
# @param id [String] Unique identifier for this event
2828
#

0 commit comments

Comments
 (0)