Skip to content

Commit c21cb20

Browse files
feat(api): manual updates
1 parent d9bad7d commit c21cb20

6 files changed

Lines changed: 19 additions & 46 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 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-2c88c6d890406ff8a5f1bca692264fb9af4bc4fe64df0986e06d3386fc6d6fcb.yml
3-
openapi_spec_hash: dc6ea17f8152708dc0a390c7f86b1a5d
4-
config_hash: a17b6052ac65237b7b8e145f4f692d3c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-e52e8d3513159931200e5d4bd32cfdc475fe6e7db6b8015c394f5625b5a3ce1f.yml
3+
openapi_spec_hash: fa597eb985cd1c3ba03acf68d6416857
4+
config_hash: b138dc33d4d0880499266048be517958

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ When the library is unable to connect to the API, or if the API returns a non-su
4646
```ruby
4747
begin
4848
session = stagehand.sessions.start(
49-
browserbase_api_key: "<your API key here>",
50-
browserbase_project_id: "<your project ID here>"
49+
browserbase_api_key: "BROWSERBASE_API_KEY",
50+
browserbase_project_id: "BROWSERBASE_PROJECT_ID"
5151
)
5252
rescue Stagehand::Errors::APIConnectionError => e
5353
puts("The server could not be reached")
@@ -92,8 +92,8 @@ stagehand = Stagehand::Client.new(
9292

9393
# Or, configure per-request:
9494
stagehand.sessions.start(
95-
browserbase_api_key: "<your API key here>",
96-
browserbase_project_id: "<your project ID here>",
95+
browserbase_api_key: "BROWSERBASE_API_KEY",
96+
browserbase_project_id: "BROWSERBASE_PROJECT_ID",
9797
request_options: {max_retries: 5}
9898
)
9999
```
@@ -110,8 +110,8 @@ stagehand = Stagehand::Client.new(
110110

111111
# Or, configure per-request:
112112
stagehand.sessions.start(
113-
browserbase_api_key: "<your API key here>",
114-
browserbase_project_id: "<your project ID here>",
113+
browserbase_api_key: "BROWSERBASE_API_KEY",
114+
browserbase_project_id: "BROWSERBASE_PROJECT_ID",
115115
request_options: {timeout: 5}
116116
)
117117
```
@@ -145,8 +145,8 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
145145
```ruby
146146
response =
147147
stagehand.sessions.start(
148-
browserbase_api_key: "<your API key here>",
149-
browserbase_project_id: "<your project ID here>",
148+
browserbase_api_key: "BROWSERBASE_API_KEY",
149+
browserbase_project_id: "BROWSERBASE_PROJECT_ID",
150150
request_options: {
151151
extra_query: {my_query_parameter: value},
152152
extra_body: {my_body_parameter: value},

lib/stagehand/models/session_execute_agent_response.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,8 @@ class SessionExecuteAgentResponse < Stagehand::Internal::Type::BaseModel
1010
# @return [String, nil]
1111
optional :message, String
1212

13-
# @!attribute steps
14-
# Steps taken by the agent
15-
#
16-
# @return [Array<Object>, nil]
17-
optional :steps, Stagehand::Internal::Type::ArrayOf[Stagehand::Internal::Type::Unknown]
18-
19-
# @!method initialize(message: nil, steps: nil)
13+
# @!method initialize(message: nil)
2014
# @param message [String] Final message from the agent
21-
#
22-
# @param steps [Array<Object>] Steps taken by the agent
2315
end
2416
end
2517
end

rbi/stagehand/models/session_execute_agent_response.rbi

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,14 @@ module Stagehand
1818
sig { params(message: String).void }
1919
attr_writer :message
2020

21-
# Steps taken by the agent
22-
sig { returns(T.nilable(T::Array[T.anything])) }
23-
attr_reader :steps
24-
25-
sig { params(steps: T::Array[T.anything]).void }
26-
attr_writer :steps
27-
28-
sig do
29-
params(message: String, steps: T::Array[T.anything]).returns(
30-
T.attached_class
31-
)
32-
end
21+
sig { params(message: String).returns(T.attached_class) }
3322
def self.new(
3423
# Final message from the agent
35-
message: nil,
36-
# Steps taken by the agent
37-
steps: nil
24+
message: nil
3825
)
3926
end
4027

41-
sig { override.returns({ message: String, steps: T::Array[T.anything] }) }
28+
sig { override.returns({ message: String }) }
4229
def to_hash
4330
end
4431
end
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
module Stagehand
22
module Models
3-
type session_execute_agent_response =
4-
{ message: String, steps: ::Array[top] }
3+
type session_execute_agent_response = { message: String }
54

65
class SessionExecuteAgentResponse < Stagehand::Internal::Type::BaseModel
76
attr_reader message: String?
87

98
def message=: (String) -> String
109

11-
attr_reader steps: ::Array[top]?
10+
def initialize: (?message: String) -> void
1211

13-
def steps=: (::Array[top]) -> ::Array[top]
14-
15-
def initialize: (?message: String, ?steps: ::Array[top]) -> void
16-
17-
def to_hash: -> { message: String, steps: ::Array[top] }
12+
def to_hash: -> { message: String }
1813
end
1914
end
2015
end

test/stagehand/resources/sessions_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ def test_execute_agent_required_params
5454

5555
assert_pattern do
5656
response => {
57-
message: String | nil,
58-
steps: ^(Stagehand::Internal::Type::ArrayOf[Stagehand::Internal::Type::Unknown]) | nil
57+
message: String | nil
5958
}
6059
end
6160
end

0 commit comments

Comments
 (0)