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 @@
{
".": "1.24.0"
".": "1.25.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 23
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-079e4949baaeab93254aa8a651f4e9976e95387b1633002e925114ce36f29013.yml
openapi_spec_hash: 331f27b62376aaf9c311af03a21d31b8
config_hash: ada0970327c433e075b4ceef583e0755
configured_endpoints: 24
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-cc8ca2c80e73bdcff491c96d9289c9e88d831215375ef83632cc51f8e8e06183.yml
openapi_spec_hash: bf55dce481efcf2f24bc9ff59c2e3f61
config_hash: cf2c7f48b329e0a61612b30cd2755ad1
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.25.0 (2026-05-31)

Full Changelog: [v1.24.0...v1.25.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.24.0...v1.25.0)

### Features

* **api:** manual updates ([688e5f5](https://github.com/context-dot-dev/context-ruby-sdk/commit/688e5f56137aeac7c5219383f241a459173f961f))

## 1.24.0 (2026-05-30)

Full Changelog: [v1.23.0...v1.24.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.23.0...v1.24.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:
context.dev (1.24.0)
context.dev (1.25.0)
cgi
connection_pool

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

```ruby
gem "context.dev", "~> 1.24.0"
gem "context.dev", "~> 1.25.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions lib/context_dev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
require_relative "context_dev/models/utility_prefetch_response"
require_relative "context_dev/models/web_extract_fonts_params"
require_relative "context_dev/models/web_extract_fonts_response"
require_relative "context_dev/models/web_extract_params"
require_relative "context_dev/models/web_extract_response"
require_relative "context_dev/models/web_extract_styleguide_params"
require_relative "context_dev/models/web_extract_styleguide_response"
require_relative "context_dev/models/web_screenshot_params"
Expand Down
10 changes: 5 additions & 5 deletions lib/context_dev/internal/type/base_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,11 @@ def deep_to_h = self.class.recursively_to_h(@data, convert: false)
# @return [Hash{Symbol=>Object}]
#
# @example
# # `web_extract_fonts_response` is a `ContextDev::Models::WebExtractFontsResponse`
# web_extract_fonts_response => {
# code: code,
# domain: domain,
# fonts: fonts
# # `web_extract_response` is a `ContextDev::Models::WebExtractResponse`
# web_extract_response => {
# data: data,
# metadata: metadata,
# status: status
# }
def deconstruct_keys(keys)
(keys || self.class.known_fields.keys)
Expand Down
2 changes: 2 additions & 0 deletions lib/context_dev/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ module ContextDev

WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams

WebExtractParams = ContextDev::Models::WebExtractParams

WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams

WebScreenshotParams = ContextDev::Models::WebScreenshotParams
Expand Down
148 changes: 148 additions & 0 deletions lib/context_dev/models/web_extract_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# frozen_string_literal: true

module ContextDev
module Models
# @see ContextDev::Resources::Web#extract
class WebExtractParams < ContextDev::Internal::Type::BaseModel
extend ContextDev::Internal::Type::RequestParameters::Converter
include ContextDev::Internal::Type::RequestParameters

# @!attribute schema
# JSON Schema for the returned data object. TypeScript Zod users can pass a JSON
# Schema generated from a Zod object; Python users can pass the equivalent JSON
# Schema object.
#
# @return [Hash{Symbol=>Object}]
required :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]

# @!attribute url
# The starting website URL to crawl and extract from. Must include http:// or
# https://.
#
# @return [String]
required :url, String

# @!attribute fact_check
# When true (default), every returned value must be grounded in facts stated on
# the page; fields that cannot be supported by the page are returned as
# null/empty. When false, the model may make reasonable inferences and derivations
# from the page content (e.g. ideal customer, competitor analysis,
# recommendations) while keeping verifiable specifics (names, quotes, URLs, dates,
# metrics) faithful to the source.
#
# @return [Boolean, nil]
optional :fact_check, ContextDev::Internal::Type::Boolean, api_name: :factCheck

# @!attribute follow_subdomains
# When true, follow links on subdomains of the starting URL's domain.
#
# @return [Boolean, nil]
optional :follow_subdomains, ContextDev::Internal::Type::Boolean, api_name: :followSubdomains

# @!attribute include_frames
# When true, iframe contents are included in Markdown before extraction.
#
# @return [Boolean, nil]
optional :include_frames, ContextDev::Internal::Type::Boolean, api_name: :includeFrames

# @!attribute instructions
# Optional extraction guidance, such as which facts to prioritize or how to
# interpret fields in the schema.
#
# @return [String, nil]
optional :instructions, String

# @!attribute max_age_ms
# Return cached scrape results if a prior scrape for the same parameters is
# younger than this many milliseconds.
#
# @return [Integer, nil]
optional :max_age_ms, Integer, api_name: :maxAgeMs

# @!attribute pdf
#
# @return [ContextDev::Models::WebExtractParams::Pdf, nil]
optional :pdf, -> { ContextDev::WebExtractParams::Pdf }

# @!attribute stop_after_ms
# Soft time budget for the crawl in milliseconds.
#
# @return [Integer, nil]
optional :stop_after_ms, Integer, api_name: :stopAfterMs

# @!attribute timeout_ms
# Optional timeout in milliseconds for the request. If the request takes longer
# than this value, it will be aborted with a 408 status code. Maximum allowed
# value is 300000ms (5 minutes).
#
# @return [Integer, nil]
optional :timeout_ms, Integer, api_name: :timeoutMS

# @!attribute wait_for_ms
# Optional browser wait time in milliseconds after initial page load for each
# crawled page.
#
# @return [Integer, nil]
optional :wait_for_ms, Integer, api_name: :waitForMs

# @!method initialize(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, pdf: nil, stop_after_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebExtractParams} for more details.
#
# @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. TypeScript Zod users can pass a JSON S
#
# @param url [String] The starting website URL to crawl and extract from. Must include http:// or http
#
# @param fact_check [Boolean] When true (default), every returned value must be grounded in facts stated on th
#
# @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain.
#
# @param include_frames [Boolean] When true, iframe contents are included in Markdown before extraction.
#
# @param instructions [String] Optional extraction guidance, such as which facts to prioritize or how to interp
#
# @param max_age_ms [Integer] Return cached scrape results if a prior scrape for the same parameters is younge
#
# @param pdf [ContextDev::Models::WebExtractParams::Pdf]
#
# @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds.
#
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
#
# @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]

class Pdf < ContextDev::Internal::Type::BaseModel
# @!attribute end_
# Last 1-based PDF page to parse. Must be greater than or equal to start when both
# are provided.
#
# @return [Integer, nil]
optional :end_, Integer, api_name: :end

# @!attribute should_parse
# When true, PDF pages are fetched and parsed. When false, PDF pages are skipped.
#
# @return [Boolean, nil]
optional :should_parse, ContextDev::Internal::Type::Boolean, api_name: :shouldParse

# @!attribute start
# First 1-based PDF page to parse.
#
# @return [Integer, nil]
optional :start, Integer

# @!method initialize(end_: nil, should_parse: nil, start: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebExtractParams::Pdf} for more details.
#
# @param end_ [Integer] Last 1-based PDF page to parse. Must be greater than or equal to start when both
#
# @param should_parse [Boolean] When true, PDF pages are fetched and parsed. When false, PDF pages are skipped.
#
# @param start [Integer] First 1-based PDF page to parse.
end
end
end
end
83 changes: 83 additions & 0 deletions lib/context_dev/models/web_extract_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# frozen_string_literal: true

module ContextDev
module Models
# @see ContextDev::Resources::Web#extract
class WebExtractResponse < ContextDev::Internal::Type::BaseModel
# @!attribute data
# Extracted data matching the request schema
#
# @return [Hash{Symbol=>Object}]
required :data, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]

# @!attribute metadata
#
# @return [ContextDev::Models::WebExtractResponse::Metadata]
required :metadata, -> { ContextDev::Models::WebExtractResponse::Metadata }

# @!attribute status
# Status of the response, e.g., 'ok'
#
# @return [String]
required :status, String

# @!attribute url
# The starting URL that was analyzed
#
# @return [String]
required :url, String

# @!attribute urls_analyzed
# List of URLs whose Markdown was used for extraction
#
# @return [Array<String>]
required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]

# @!method initialize(data:, metadata:, status:, url:, urls_analyzed:)
# @param data [Hash{Symbol=>Object}] Extracted data matching the request schema
#
# @param metadata [ContextDev::Models::WebExtractResponse::Metadata]
#
# @param status [String] Status of the response, e.g., 'ok'
#
# @param url [String] The starting URL that was analyzed
#
# @param urls_analyzed [Array<String>] List of URLs whose Markdown was used for extraction

# @see ContextDev::Models::WebExtractResponse#metadata
class Metadata < ContextDev::Internal::Type::BaseModel
# @!attribute max_crawl_depth
#
# @return [Integer]
required :max_crawl_depth, Integer, api_name: :maxCrawlDepth

# @!attribute num_failed
#
# @return [Integer]
required :num_failed, Integer, api_name: :numFailed

# @!attribute num_skipped
#
# @return [Integer]
required :num_skipped, Integer, api_name: :numSkipped

# @!attribute num_succeeded
#
# @return [Integer]
required :num_succeeded, Integer, api_name: :numSucceeded

# @!attribute num_urls
#
# @return [Integer]
required :num_urls, Integer, api_name: :numUrls

# @!method initialize(max_crawl_depth:, num_failed:, num_skipped:, num_succeeded:, num_urls:)
# @param max_crawl_depth [Integer]
# @param num_failed [Integer]
# @param num_skipped [Integer]
# @param num_succeeded [Integer]
# @param num_urls [Integer]
end
end
end
end
48 changes: 48 additions & 0 deletions lib/context_dev/resources/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@
module ContextDev
module Resources
class Web
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebExtractParams} for more details.
#
# Crawl a website, convert pages to Markdown using the scrape cache, and extract
# structured data into the provided JSON Schema. The schema must describe the
# response data object. This endpoint does not accept targeted page-type
# selection.
#
# @overload extract(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, pdf: nil, stop_after_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
#
# @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. TypeScript Zod users can pass a JSON S
#
# @param url [String] The starting website URL to crawl and extract from. Must include http:// or http
#
# @param fact_check [Boolean] When true (default), every returned value must be grounded in facts stated on th
#
# @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain.
#
# @param include_frames [Boolean] When true, iframe contents are included in Markdown before extraction.
#
# @param instructions [String] Optional extraction guidance, such as which facts to prioritize or how to interp
#
# @param max_age_ms [Integer] Return cached scrape results if a prior scrape for the same parameters is younge
#
# @param pdf [ContextDev::Models::WebExtractParams::Pdf]
#
# @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds.
#
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
#
# @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [ContextDev::Models::WebExtractResponse]
#
# @see ContextDev::Models::WebExtractParams
def extract(params)
parsed, options = ContextDev::WebExtractParams.dump_request(params)
@client.request(
method: :post,
path: "web/extract",
body: parsed,
model: ContextDev::Models::WebExtractResponse,
options: options
)
end

# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebExtractFontsParams} for more details.
#
Expand Down
2 changes: 1 addition & 1 deletion lib/context_dev/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ContextDev
VERSION = "1.24.0"
VERSION = "1.25.0"
end
2 changes: 2 additions & 0 deletions rbi/context_dev/models.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ module ContextDev

WebExtractFontsParams = ContextDev::Models::WebExtractFontsParams

WebExtractParams = ContextDev::Models::WebExtractParams

WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams

WebScreenshotParams = ContextDev::Models::WebScreenshotParams
Expand Down
Loading
Loading