Skip to content
Closed
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 @@
{
".": "2.12.0"
".": "2.13.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: 41
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2c3f4e4b357ca78c019a3aacd006e2bb8b332d4172a300ee6c46c076a216ed3f.yml
openapi_spec_hash: b89be415cf6ee594b521885a9deb25ac
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-dc61df29e1b6282f9df685fadd65f3683afe352deccae94d0c080092e0eae4b3.yml
openapi_spec_hash: 258caa98cd0de5f7149f6937d071c912
config_hash: 0fb0ceca5946298c416cec0cca5260c7
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.13.0 (2026-08-27)

Full Changelog: [v2.12.0...v2.13.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.12.0...v2.13.0)

### Features

* **api:** api update ([4013ce1](https://github.com/context-dot-dev/context-ruby-sdk/commit/4013ce1096f05d3ccf50bf261eb04c6e10daf23a))
* **api:** api update ([52fcdf2](https://github.com/context-dot-dev/context-ruby-sdk/commit/52fcdf27ba3a0a00c7ebc3800d2057dde4b620dc))

## 2.12.0 (2026-08-23)

Full Changelog: [v2.11.0...v2.12.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.11.0...v2.12.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 (2.12.0)
context.dev (2.13.0)
cgi
connection_pool

Expand Down
4 changes: 2 additions & 2 deletions 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", "~> 2.12.0"
gem "context.dev", "~> 2.13.0"
```

<!-- x-release-please-end -->
Expand All @@ -43,7 +43,7 @@ context_dev = ContextDev::Client.new(

brand = context_dev.brand.retrieve(body: {domain: "stripe.com", type: "by_domain"})

puts(brand.brand)
puts(brand.cache_metadata)
```

### Handling errors
Expand Down
55 changes: 54 additions & 1 deletion lib/context_dev/models/ai_extract_product_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ module ContextDev
module Models
# @see ContextDev::Resources::AI#extract_product
class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
# @!attribute cache_metadata
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @return [ContextDev::Models::AIExtractProductResponse::CacheMetadata]
required :cache_metadata, -> { ContextDev::Models::AIExtractProductResponse::CacheMetadata }

# @!attribute is_product_page
# Whether the given URL is a product detail page
#
Expand All @@ -29,10 +37,12 @@ class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
# @return [ContextDev::Models::AIExtractProductResponse::Product, nil]
optional :product, -> { ContextDev::Models::AIExtractProductResponse::Product }, nil?: true

# @!method initialize(is_product_page: nil, key_metadata: nil, platform: nil, product: nil)
# @!method initialize(cache_metadata:, is_product_page: nil, key_metadata: nil, platform: nil, product: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::AIExtractProductResponse} for more details.
#
# @param cache_metadata [ContextDev::Models::AIExtractProductResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
#
# @param is_product_page [Boolean] Whether the given URL is a product detail page
#
# @param key_metadata [ContextDev::Models::AIExtractProductResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
Expand All @@ -41,6 +51,49 @@ class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
#
# @param product [ContextDev::Models::AIExtractProductResponse::Product, nil] The extracted product data, or null if not a product page

# @see ContextDev::Models::AIExtractProductResponse#cache_metadata
class CacheMetadata < ContextDev::Internal::Type::BaseModel
# @!attribute age_ms
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @return [Integer]
required :age_ms, Integer

# @!attribute status
# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @return [Symbol, ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status]
required :status, enum: -> { ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status }

# @!method initialize(age_ms:, status:)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::AIExtractProductResponse::CacheMetadata} for more details.
#
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @param status [Symbol, ContextDev::Models::AIExtractProductResponse::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero

# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @see ContextDev::Models::AIExtractProductResponse::CacheMetadata#status
module Status
extend ContextDev::Internal::Type::Enum

HIT = :hit
MISS = :miss
ZDR = :zdr

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

# @see ContextDev::Models::AIExtractProductResponse#key_metadata
class KeyMetadata < ContextDev::Internal::Type::BaseModel
# @!attribute credits_consumed
Expand Down
55 changes: 54 additions & 1 deletion lib/context_dev/models/ai_extract_products_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ module ContextDev
module Models
# @see ContextDev::Resources::AI#extract_products
class AIExtractProductsResponse < ContextDev::Internal::Type::BaseModel
# @!attribute cache_metadata
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @return [ContextDev::Models::AIExtractProductsResponse::CacheMetadata]
required :cache_metadata, -> { ContextDev::Models::AIExtractProductsResponse::CacheMetadata }

# @!attribute key_metadata
# Metadata about the API key used for the request. Included in every response
# whenever a valid API key is provided, even when the response status is not 200.
Expand All @@ -18,14 +26,59 @@ class AIExtractProductsResponse < ContextDev::Internal::Type::BaseModel
optional :products,
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::AIExtractProductsResponse::Product] }

# @!method initialize(key_metadata: nil, products: nil)
# @!method initialize(cache_metadata:, key_metadata: nil, products: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::AIExtractProductsResponse} for more details.
#
# @param cache_metadata [ContextDev::Models::AIExtractProductsResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
#
# @param key_metadata [ContextDev::Models::AIExtractProductsResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
#
# @param products [Array<ContextDev::Models::AIExtractProductsResponse::Product>] Array of products extracted from the website

# @see ContextDev::Models::AIExtractProductsResponse#cache_metadata
class CacheMetadata < ContextDev::Internal::Type::BaseModel
# @!attribute age_ms
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @return [Integer]
required :age_ms, Integer

# @!attribute status
# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @return [Symbol, ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status]
required :status, enum: -> { ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status }

# @!method initialize(age_ms:, status:)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::AIExtractProductsResponse::CacheMetadata} for more details.
#
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @param status [Symbol, ContextDev::Models::AIExtractProductsResponse::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero

# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @see ContextDev::Models::AIExtractProductsResponse::CacheMetadata#status
module Status
extend ContextDev::Internal::Type::Enum

HIT = :hit
MISS = :miss
ZDR = :zdr

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

# @see ContextDev::Models::AIExtractProductsResponse#key_metadata
class KeyMetadata < ContextDev::Internal::Type::BaseModel
# @!attribute credits_consumed
Expand Down
57 changes: 56 additions & 1 deletion lib/context_dev/models/batch_get_results_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ module Data
variant :error, -> { ContextDev::Models::BatchGetResultsResponse::Data::Error }

class Ok < ContextDev::Internal::Type::BaseModel
# @!attribute cache_metadata
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @return [ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata]
required :cache_metadata, -> { ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata }

# @!attribute final_url
# URL the content was read from, after redirects.
#
Expand Down Expand Up @@ -117,12 +125,14 @@ class Ok < ContextDev::Internal::Type::BaseModel
# @return [Integer, nil]
optional :ocr_pages, Integer

# @!method initialize(final_url:, http_status:, metadata:, url:, html: nil, item_id: nil, markdown: nil, meta: nil, ocr_pages: nil, status: :ok)
# @!method initialize(cache_metadata:, final_url:, http_status:, metadata:, url:, html: nil, item_id: nil, markdown: nil, meta: nil, ocr_pages: nil, status: :ok)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::BatchGetResultsResponse::Data::Ok} for more details.
#
# A page the batch fetched successfully.
#
# @param cache_metadata [ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
#
# @param final_url [String] URL the content was read from, after redirects.
#
# @param http_status [Integer, nil] HTTP status of the final response, when known.
Expand All @@ -143,6 +153,51 @@ class Ok < ContextDev::Internal::Type::BaseModel
#
# @param status [Symbol, :ok] The page was scraped.

# @see ContextDev::Models::BatchGetResultsResponse::Data::Ok#cache_metadata
class CacheMetadata < ContextDev::Internal::Type::BaseModel
# @!attribute age_ms
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @return [Integer]
required :age_ms, Integer

# @!attribute status
# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @return [Symbol, ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status]
required :status,
enum: -> { ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status }

# @!method initialize(age_ms:, status:)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata} for more
# details.
#
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @param status [Symbol, ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero

# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @see ContextDev::Models::BatchGetResultsResponse::Data::Ok::CacheMetadata#status
module Status
extend ContextDev::Internal::Type::Enum

HIT = :hit
MISS = :miss
ZDR = :zdr

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

# @see ContextDev::Models::BatchGetResultsResponse::Data::Ok#metadata
class Metadata < ContextDev::Internal::Type::BaseModel
# @!attribute final_url
Expand Down
55 changes: 54 additions & 1 deletion lib/context_dev/models/batch_submit_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ class BatchSubmitResponse < ContextDev::Internal::Type::BaseModel
# @return [String]
required :id, String

# @!attribute cache_metadata
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @return [ContextDev::Models::BatchSubmitResponse::CacheMetadata]
required :cache_metadata, -> { ContextDev::Models::BatchSubmitResponse::CacheMetadata }

# @!attribute crawl
# The crawl controls as submitted, so the limits requested can be compared against
# what the crawl reached.
Expand Down Expand Up @@ -79,12 +87,14 @@ class BatchSubmitResponse < ContextDev::Internal::Type::BaseModel
# @return [String, nil]
optional :webhook_secret, String

# @!method initialize(id:, crawl:, created_at:, credits:, format_:, input:, invalid_urls:, mode:, status:, tags:, key_metadata: nil, webhook_secret: nil)
# @!method initialize(id:, cache_metadata:, crawl:, created_at:, credits:, format_:, input:, invalid_urls:, mode:, status:, tags:, key_metadata: nil, webhook_secret: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::BatchSubmitResponse} for more details.
#
# @param id [String] Batch ID. Poll GET /batch/{batch_id} with it.
#
# @param cache_metadata [ContextDev::Models::BatchSubmitResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
#
# @param crawl [ContextDev::Models::CrawlControls, nil] The crawl controls as submitted, so the limits requested can be compared against
#
# @param created_at [String] When the batch was created.
Expand All @@ -107,6 +117,49 @@ class BatchSubmitResponse < ContextDev::Internal::Type::BaseModel
#
# @param webhook_secret [String] Signing secret for the completion webhook, returned only here and never again. S

# @see ContextDev::Models::BatchSubmitResponse#cache_metadata
class CacheMetadata < ContextDev::Internal::Type::BaseModel
# @!attribute age_ms
# Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @return [Integer]
required :age_ms, Integer

# @!attribute status
# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @return [Symbol, ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status]
required :status, enum: -> { ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status }

# @!method initialize(age_ms:, status:)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::BatchSubmitResponse::CacheMetadata} for more details.
#
# Cache outcome for this response. Composite responses are hits only when every
# cache-controlled fetch contributing to the output was a hit; age_ms is the
# oldest contributing hit.
#
# @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
#
# @param status [Symbol, ContextDev::Models::BatchSubmitResponse::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero

# Whether the response was served from cache, required fresh work, or honored
# zero-data-retention cache bypass.
#
# @see ContextDev::Models::BatchSubmitResponse::CacheMetadata#status
module Status
extend ContextDev::Internal::Type::Enum

HIT = :hit
MISS = :miss
ZDR = :zdr

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

# @see ContextDev::Models::BatchSubmitResponse#credits
class Credits < ContextDev::Internal::Type::BaseModel
# @!attribute reserved
Expand Down
Loading