Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0"
".": "0.2.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-2c88c6d890406ff8a5f1bca692264fb9af4bc4fe64df0986e06d3386fc6d6fcb.yml
openapi_spec_hash: dc6ea17f8152708dc0a390c7f86b1a5d
config_hash: b01f15c540ab2c92808c2bba96368631
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-705638ac8966569986bd9ebb7c9761bf0016909e9f2753e77ceabb12c8049511.yml
openapi_spec_hash: a8fbbcaa38e91c7f97313620b42d8d62
config_hash: a35b56eb05306a0f02e83c11d57f975f
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.2.0 (2025-12-16)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/browserbase/stagehand-ruby/compare/v0.1.0...v0.2.0)

### Features

* **api:** manual updates ([d660a3a](https://github.com/browserbase/stagehand-ruby/commit/d660a3ad9cd54238d2bc6598b576e7677ebf120f))
* **api:** manual updates ([c21cb20](https://github.com/browserbase/stagehand-ruby/commit/c21cb20650bbad1ba8f6a89ad33dcf5ddfc53c81))
* **api:** manual updates ([f04453c](https://github.com/browserbase/stagehand-ruby/commit/f04453c6c2050b7815e3f62d14343dee4698879d))

## 0.1.0 (2025-12-16)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/browserbase/stagehand-ruby/compare/v0.0.1...v0.1.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
stagehand (0.1.0)
stagehand (0.2.0)
connection_pool

GEM
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "stagehand", "~> 0.1.0"
gem "stagehand", "~> 0.2.0"
```

<!-- x-release-please-end -->
Expand All @@ -34,7 +34,7 @@ stagehand = Stagehand::Client.new(
model_api_key: ENV["MODEL_API_KEY"] # This is the default and can be omitted
)

response = stagehand.sessions.act("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", input: "click the first link on the page")
response = stagehand.sessions.act("00000000-your-session-id-000000000000", input: "click the first link on the page")

puts(response.actions)
```
Expand All @@ -46,8 +46,8 @@ When the library is unable to connect to the API, or if the API returns a non-su
```ruby
begin
session = stagehand.sessions.start(
browserbase_api_key: "BROWSERBASE_API_KEY",
browserbase_project_id: "BROWSERBASE_PROJECT_ID"
browserbase_api_key: "your Browserbase API key",
browserbase_project_id: "your Browserbase Project ID"
)
rescue Stagehand::Errors::APIConnectionError => e
puts("The server could not be reached")
Expand Down Expand Up @@ -92,8 +92,8 @@ stagehand = Stagehand::Client.new(

# Or, configure per-request:
stagehand.sessions.start(
browserbase_api_key: "BROWSERBASE_API_KEY",
browserbase_project_id: "BROWSERBASE_PROJECT_ID",
browserbase_api_key: "your Browserbase API key",
browserbase_project_id: "your Browserbase Project ID",
request_options: {max_retries: 5}
)
```
Expand All @@ -110,8 +110,8 @@ stagehand = Stagehand::Client.new(

# Or, configure per-request:
stagehand.sessions.start(
browserbase_api_key: "BROWSERBASE_API_KEY",
browserbase_project_id: "BROWSERBASE_PROJECT_ID",
browserbase_api_key: "your Browserbase API key",
browserbase_project_id: "your Browserbase Project ID",
request_options: {timeout: 5}
)
```
Expand Down Expand Up @@ -145,8 +145,8 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
```ruby
response =
stagehand.sessions.start(
browserbase_api_key: "BROWSERBASE_API_KEY",
browserbase_project_id: "BROWSERBASE_PROJECT_ID",
browserbase_api_key: "your Browserbase API key",
browserbase_project_id: "your Browserbase Project ID",
request_options: {
extra_query: {my_query_parameter: value},
extra_body: {my_body_parameter: value},
Expand Down Expand Up @@ -192,18 +192,18 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
You can provide typesafe request parameters like so:

```ruby
stagehand.sessions.act("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", input: "click the first link on the page")
stagehand.sessions.act("00000000-your-session-id-000000000000", input: "click the first link on the page")
```

Or, equivalently:

```ruby
# Hashes work, but are not typesafe:
stagehand.sessions.act("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", input: "click the first link on the page")
stagehand.sessions.act("00000000-your-session-id-000000000000", input: "click the first link on the page")

# You can also splat a full Params class:
params = Stagehand::SessionActParams.new(input: "click the first link on the page")
stagehand.sessions.act("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", **params)
stagehand.sessions.act("00000000-your-session-id-000000000000", **params)
```

### Enums
Expand Down
10 changes: 1 addition & 9 deletions lib/stagehand/models/session_execute_agent_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ class SessionExecuteAgentResponse < Stagehand::Internal::Type::BaseModel
# @return [String, nil]
optional :message, String

# @!attribute steps
# Steps taken by the agent
#
# @return [Array<Object>, nil]
optional :steps, Stagehand::Internal::Type::ArrayOf[Stagehand::Internal::Type::Unknown]

# @!method initialize(message: nil, steps: nil)
# @!method initialize(message: nil)
# @param message [String] Final message from the agent
#
# @param steps [Array<Object>] Steps taken by the agent
end
end
end
2 changes: 1 addition & 1 deletion lib/stagehand/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Stagehand
VERSION = "0.1.0"
VERSION = "0.2.0"
end
19 changes: 3 additions & 16 deletions rbi/stagehand/models/session_execute_agent_response.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,14 @@ module Stagehand
sig { params(message: String).void }
attr_writer :message

# Steps taken by the agent
sig { returns(T.nilable(T::Array[T.anything])) }
attr_reader :steps

sig { params(steps: T::Array[T.anything]).void }
attr_writer :steps

sig do
params(message: String, steps: T::Array[T.anything]).returns(
T.attached_class
)
end
sig { params(message: String).returns(T.attached_class) }
def self.new(
# Final message from the agent
message: nil,
# Steps taken by the agent
steps: nil
message: nil
)
end

sig { override.returns({ message: String, steps: T::Array[T.anything] }) }
sig { override.returns({ message: String }) }
def to_hash
end
end
Expand Down
11 changes: 3 additions & 8 deletions sig/stagehand/models/session_execute_agent_response.rbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
module Stagehand
module Models
type session_execute_agent_response =
{ message: String, steps: ::Array[top] }
type session_execute_agent_response = { message: String }

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

def message=: (String) -> String

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

def steps=: (::Array[top]) -> ::Array[top]

def initialize: (?message: String, ?steps: ::Array[top]) -> void

def to_hash: -> { message: String, steps: ::Array[top] }
def to_hash: -> { message: String }
end
end
end
3 changes: 1 addition & 2 deletions test/stagehand/resources/sessions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def test_execute_agent_required_params

assert_pattern do
response => {
message: String | nil,
steps: ^(Stagehand::Internal::Type::ArrayOf[Stagehand::Internal::Type::Unknown]) | nil
message: String | nil
}
end
end
Expand Down
Loading