Skip to content
Open
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
github.repository == 'stainless-sdks/stagehand-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
bundler-cache: false
- run: |-
Expand All @@ -39,7 +39,7 @@ jobs:
github.repository == 'stainless-sdks/stagehand-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

Expand All @@ -60,9 +60,9 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
bundler-cache: false
- run: |-
Expand All @@ -76,9 +76,9 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/stagehand-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
bundler-cache: false
- run: |-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0
with:
bundler-cache: false
- run: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'browserbase/stagehand-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check release environment
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.20.0"
".": "3.21.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-6f6bfb81d092f30a5e2005328c97d61b9ea36132bb19e9e79e55294b9534ce20.yml
openapi_spec_hash: f3fc1e3688a38dc2c28f7178f7d534e5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-80502d74c1be605e77d45ff2b54297fe34ce85dbad1e8f2dfa30ba6d09601219.yml
openapi_spec_hash: fd62f768756a400c3ecd695bfcf3845a
config_hash: 1fb12ae9b478488bc1e56bfbdc210b01
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 3.21.0 (2026-05-20)

Full Changelog: [v3.20.0...v3.21.0](https://github.com/browserbase/stagehand-ruby/compare/v3.20.0...v3.21.0)

### Features

* [feat]: add `ignoreSelectors` to `observe()` ([0acc093](https://github.com/browserbase/stagehand-ruby/commit/0acc093944e72ee488393ec1fb73dc16450cc825))
* Add `screenshot` option to Extract ([7b65ca7](https://github.com/browserbase/stagehand-ruby/commit/7b65ca776e1e13c489f13991b012fa24aecc60e6))
* STG-1756 add Vertex auth params to Stagehand spec ([4b65f22](https://github.com/browserbase/stagehand-ruby/commit/4b65f221055c7d0d3d7426845fbd0e49ba13d2df))


### Bug Fixes

* **client:** elide content type header on requests without body ([6149c11](https://github.com/browserbase/stagehand-ruby/commit/6149c11d9ab60a0cac69f1e26e3a2f42425ad616))

## 3.20.0 (2026-05-06)

Full Changelog: [v3.19.3...v3.20.0](https://github.com/browserbase/stagehand-ruby/compare/v3.19.3...v3.20.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 (3.20.0)
stagehand (3.21.0)
cgi
connection_pool

Expand Down
2 changes: 2 additions & 0 deletions lib/stagehand/internal/transport/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ def initialize(
Stagehand::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
end

headers.delete("content-type") if body.nil?

url = Stagehand::Internal::Util.join_parsed_uri(
@base_url_components,
{**req, path: path, query: query}
Expand Down
167 changes: 166 additions & 1 deletion lib/stagehand/models/model_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,193 @@ class ModelConfig < Stagehand::Internal::Type::BaseModel
# @return [String, nil]
optional :base_url, String, api_name: :baseURL

# @!attribute google_auth_options
# google-auth-library options used to authenticate Vertex AI models
#
# @return [Stagehand::Models::ModelConfig::GoogleAuthOptions, nil]
optional :google_auth_options,
-> { Stagehand::ModelConfig::GoogleAuthOptions },
api_name: :googleAuthOptions

# @!attribute headers
# Custom headers sent with every request to the model provider
#
# @return [Hash{Symbol=>String}, nil]
optional :headers, Stagehand::Internal::Type::HashOf[String]

# @!attribute location
# Google Cloud location for Vertex AI models
#
# @return [String, nil]
optional :location, String

# @!attribute project
# Google Cloud project ID for Vertex AI models
#
# @return [String, nil]
optional :project, String

# @!attribute provider
# AI provider for the model (or provide a baseURL endpoint instead)
#
# @return [Symbol, Stagehand::Models::ModelConfig::Provider, nil]
optional :provider, enum: -> { Stagehand::ModelConfig::Provider }

# @!method initialize(model_name:, api_key: nil, base_url: nil, headers: nil, provider: nil)
# @!method initialize(model_name:, api_key: nil, base_url: nil, google_auth_options: nil, headers: nil, location: nil, project: nil, provider: nil)
# @param model_name [String] Model name string with provider prefix (e.g., 'openai/gpt-5-nano')
#
# @param api_key [String] API key for the model provider
#
# @param base_url [String] Base URL for the model provider
#
# @param google_auth_options [Stagehand::Models::ModelConfig::GoogleAuthOptions] google-auth-library options used to authenticate Vertex AI models
#
# @param headers [Hash{Symbol=>String}] Custom headers sent with every request to the model provider
#
# @param location [String] Google Cloud location for Vertex AI models
#
# @param project [String] Google Cloud project ID for Vertex AI models
#
# @param provider [Symbol, Stagehand::Models::ModelConfig::Provider] AI provider for the model (or provide a baseURL endpoint instead)

# @see Stagehand::Models::ModelConfig#google_auth_options
class GoogleAuthOptions < Stagehand::Internal::Type::BaseModel
# @!attribute credentials
# Google Cloud service account credentials
#
# @return [Stagehand::Models::ModelConfig::GoogleAuthOptions::Credentials, nil]
optional :credentials, -> { Stagehand::ModelConfig::GoogleAuthOptions::Credentials }

# @!attribute project_id
# Google Cloud project ID used by google-auth-library
#
# @return [String, nil]
optional :project_id, String, api_name: :projectId

# @!attribute scopes
# Google auth scopes for the desired API request
#
# @return [String, Array<String>, nil]
optional :scopes, union: -> { Stagehand::ModelConfig::GoogleAuthOptions::Scopes }

# @!attribute universe_domain
# Google Cloud universe domain
#
# @return [String, nil]
optional :universe_domain, String, api_name: :universeDomain

# @!method initialize(credentials: nil, project_id: nil, scopes: nil, universe_domain: nil)
# google-auth-library options used to authenticate Vertex AI models
#
# @param credentials [Stagehand::Models::ModelConfig::GoogleAuthOptions::Credentials] Google Cloud service account credentials
#
# @param project_id [String] Google Cloud project ID used by google-auth-library
#
# @param scopes [String, Array<String>] Google auth scopes for the desired API request
#
# @param universe_domain [String] Google Cloud universe domain

# @see Stagehand::Models::ModelConfig::GoogleAuthOptions#credentials
class Credentials < Stagehand::Internal::Type::BaseModel
# @!attribute client_email
#
# @return [String]
required :client_email, String

# @!attribute private_key
#
# @return [String]
required :private_key, String

# @!attribute auth_provider_x509_cert_url
#
# @return [String, nil]
optional :auth_provider_x509_cert_url, String

# @!attribute auth_uri
#
# @return [String, nil]
optional :auth_uri, String

# @!attribute client_id
#
# @return [String, nil]
optional :client_id, String

# @!attribute client_x509_cert_url
#
# @return [String, nil]
optional :client_x509_cert_url, String

# @!attribute private_key_id
#
# @return [String, nil]
optional :private_key_id, String

# @!attribute project_id
#
# @return [String, nil]
optional :project_id, String

# @!attribute token_uri
#
# @return [String, nil]
optional :token_uri, String

# @!attribute type
#
# @return [Symbol, Stagehand::Models::ModelConfig::GoogleAuthOptions::Credentials::Type, nil]
optional :type, enum: -> { Stagehand::ModelConfig::GoogleAuthOptions::Credentials::Type }

# @!attribute universe_domain
#
# @return [String, nil]
optional :universe_domain, String

# @!method initialize(client_email:, private_key:, auth_provider_x509_cert_url: nil, auth_uri: nil, client_id: nil, client_x509_cert_url: nil, private_key_id: nil, project_id: nil, token_uri: nil, type: nil, universe_domain: nil)
# Google Cloud service account credentials
#
# @param client_email [String]
# @param private_key [String]
# @param auth_provider_x509_cert_url [String]
# @param auth_uri [String]
# @param client_id [String]
# @param client_x509_cert_url [String]
# @param private_key_id [String]
# @param project_id [String]
# @param token_uri [String]
# @param type [Symbol, Stagehand::Models::ModelConfig::GoogleAuthOptions::Credentials::Type]
# @param universe_domain [String]

# @see Stagehand::Models::ModelConfig::GoogleAuthOptions::Credentials#type
module Type
extend Stagehand::Internal::Type::Enum

SERVICE_ACCOUNT = :service_account

# @!method self.values
# @return [Array<Symbol>]
end
end

# Google auth scopes for the desired API request
#
# @see Stagehand::Models::ModelConfig::GoogleAuthOptions#scopes
module Scopes
extend Stagehand::Internal::Type::Union

variant String

variant -> { Stagehand::Models::ModelConfig::GoogleAuthOptions::Scopes::StringArray }

# @!method self.variants
# @return [Array(String, Array<String>)]

# @type [Stagehand::Internal::Type::Converter]
StringArray = Stagehand::Internal::Type::ArrayOf[String]
end
end

# AI provider for the model (or provide a baseURL endpoint instead)
#
# @see Stagehand::Models::ModelConfig#provider
Expand All @@ -55,6 +219,7 @@ module Provider
GOOGLE = :google
MICROSOFT = :microsoft
BEDROCK = :bedrock
VERTEX = :vertex

# @!method self.values
# @return [Array<Symbol>]
Expand Down
14 changes: 13 additions & 1 deletion lib/stagehand/models/session_extract_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ class Options < Stagehand::Internal::Type::BaseModel
# @return [Stagehand::Models::ModelConfig, String, nil]
optional :model, union: -> { Stagehand::SessionExtractParams::Options::Model }

# @!attribute screenshot
# When true, include a screenshot of the current viewport in the extraction LLM
# call. Defaults to false.
#
# @return [Boolean, nil]
optional :screenshot, Stagehand::Internal::Type::Boolean

# @!attribute selector
# CSS selector to scope extraction to a specific element
#
Expand All @@ -84,11 +91,16 @@ class Options < Stagehand::Internal::Type::BaseModel
# @return [Float, nil]
optional :timeout, Float

# @!method initialize(ignore_selectors: nil, model: nil, selector: nil, timeout: nil)
# @!method initialize(ignore_selectors: nil, model: nil, screenshot: nil, selector: nil, timeout: nil)
# Some parameter documentations has been truncated, see
# {Stagehand::Models::SessionExtractParams::Options} for more details.
#
# @param ignore_selectors [Array<String>] Selectors for elements and subtrees that should be excluded from extraction
#
# @param model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
#
# @param screenshot [Boolean] When true, include a screenshot of the current viewport in the extraction LLM ca
#
# @param selector [String] CSS selector to scope extraction to a specific element
#
# @param timeout [Float] Timeout in ms for the extraction
Expand Down
10 changes: 9 additions & 1 deletion lib/stagehand/models/session_observe_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class SessionObserveParams < Stagehand::Internal::Type::BaseModel
# @param request_options [Stagehand::RequestOptions, Hash{Symbol=>Object}]

class Options < Stagehand::Internal::Type::BaseModel
# @!attribute ignore_selectors
# Selectors for elements and subtrees that should be excluded from observation
#
# @return [Array<String>, nil]
optional :ignore_selectors, Stagehand::Internal::Type::ArrayOf[String], api_name: :ignoreSelectors

# @!attribute model
# Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
#
Expand Down Expand Up @@ -79,10 +85,12 @@ class Options < Stagehand::Internal::Type::BaseModel
optional :variables,
-> { Stagehand::Internal::Type::HashOf[union: Stagehand::SessionObserveParams::Options::Variable] }

# @!method initialize(model: nil, selector: nil, timeout: nil, variables: nil)
# @!method initialize(ignore_selectors: nil, model: nil, selector: nil, timeout: nil, variables: nil)
# Some parameter documentations has been truncated, see
# {Stagehand::Models::SessionObserveParams::Options} for more details.
#
# @param ignore_selectors [Array<String>] Selectors for elements and subtrees that should be excluded from observation
#
# @param model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
#
# @param selector [String] CSS selector to scope observation to a specific element
Expand Down
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 = "3.20.0"
VERSION = "3.21.0"
end
Loading