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.13.0"
".": "1.14.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: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4a46f38182c87694de28ad72b2ebb873d3004533dbe8db3276637d6d80cf9a33.yml
openapi_spec_hash: b10ee8536928665190a110738964fccb
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-bfa54d26b675d92a0b3db3e3c2147dc98250fb1e4cb82bb6bd6f9af544763506.yml
openapi_spec_hash: 7d834a5553262d0a2538bc066f39d549
config_hash: 70354330f92ce169beabc98696ebb9a3
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.14.0 (2026-05-06)

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

### Features

* **api:** api update ([58cb73a](https://github.com/context-dot-dev/context-ruby-sdk/commit/58cb73a109e20f296f6a5f256a94d690b1203f70))

## 1.13.0 (2026-05-05)

Full Changelog: [v1.12.0...v1.13.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.12.0...v1.13.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.13.0)
context.dev (1.14.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.13.0"
gem "context.dev", "~> 1.14.0"
```

<!-- x-release-please-end -->
Expand Down
69 changes: 66 additions & 3 deletions lib/context_dev/models/web_web_scrape_images_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,78 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel
include ContextDev::Internal::Type::RequestParameters

# @!attribute url
# Full URL to scrape images from (must include http:// or https:// protocol)
# Page URL to inspect. Must include http:// or https://.
#
# @return [String]
required :url, String

# @!method initialize(url:, request_options: {})
# @param url [String] Full URL to scrape images from (must include http:// or https:// protocol)
# @!attribute enrichment
# Optional per-image processing, sent as deep-object query params such as
# enrichment[resolution]=true.
#
# @return [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil]
optional :enrichment, -> { ContextDev::WebWebScrapeImagesParams::Enrichment }

# @!attribute max_age_ms
# Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
# day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).
#
# @return [Integer, nil]
optional :max_age_ms, Integer

# @!method initialize(url:, enrichment: nil, max_age_ms: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebScrapeImagesParams} for more details.
#
# @param url [String] Page URL to inspect. Must include http:// or https://.
#
# @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme
#
# @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]

class Enrichment < ContextDev::Internal::Type::BaseModel
# @!attribute classification
# Classify each image by visual asset type.
#
# @return [Boolean, nil]
optional :classification, ContextDev::Internal::Type::Boolean

# @!attribute hosted_url
# Host materializable images on the Brand.dev CDN and return their URL and MIME
# type.
#
# @return [Boolean, nil]
optional :hosted_url, ContextDev::Internal::Type::Boolean, api_name: :hostedUrl

# @!attribute max_time_per_ms
# Per-image enrichment timeout in milliseconds. Default: 6000. Maximum: 60000.
#
# @return [Integer, nil]
optional :max_time_per_ms, Integer, api_name: :maxTimePerMs

# @!attribute resolution
# Measure image width and height when possible.
#
# @return [Boolean, nil]
optional :resolution, ContextDev::Internal::Type::Boolean

# @!method initialize(classification: nil, hosted_url: nil, max_time_per_ms: nil, resolution: nil)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebScrapeImagesParams::Enrichment} for more details.
#
# Optional per-image processing, sent as deep-object query params such as
# enrichment[resolution]=true.
#
# @param classification [Boolean] Classify each image by visual asset type.
#
# @param hosted_url [Boolean] Host materializable images on the Brand.dev CDN and return their URL and MIME ty
#
# @param max_time_per_ms [Integer] Per-image enrichment timeout in milliseconds. Default: 6000. Maximum: 60000.
#
# @param resolution [Boolean] Measure image width and height when possible.
end
end
end
end
109 changes: 91 additions & 18 deletions lib/context_dev/models/web_web_scrape_images_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,74 @@ module Models
# @see ContextDev::Resources::Web#web_scrape_images
class WebWebScrapeImagesResponse < ContextDev::Internal::Type::BaseModel
# @!attribute images
# Array of scraped images
# Images found on the page.
#
# @return [Array<ContextDev::Models::WebWebScrapeImagesResponse::Image>]
required :images,
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebWebScrapeImagesResponse::Image] }

# @!attribute success
# Indicates success
# Always true on success.
#
# @return [Boolean, ContextDev::Models::WebWebScrapeImagesResponse::Success]
required :success, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::Success }

# @!attribute url
# The URL that was scraped
# Page URL that was scraped.
#
# @return [String]
required :url, String

# @!method initialize(images:, success:, url:)
# @param images [Array<ContextDev::Models::WebWebScrapeImagesResponse::Image>] Array of scraped images
# @param images [Array<ContextDev::Models::WebWebScrapeImagesResponse::Image>] Images found on the page.
#
# @param success [Boolean, ContextDev::Models::WebWebScrapeImagesResponse::Success] Indicates success
# @param success [Boolean, ContextDev::Models::WebWebScrapeImagesResponse::Success] Always true on success.
#
# @param url [String] The URL that was scraped
# @param url [String] Page URL that was scraped.

class Image < ContextDev::Internal::Type::BaseModel
# @!attribute alt
# Alt text of the image, or null if not present
# Image alt text, or null when unavailable.
#
# @return [String, nil]
required :alt, String, nil?: true

# @!attribute element
# The HTML element the image was found in
# Where the image was found.
#
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Element]
required :element, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::Image::Element }

# @!attribute src
# The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI
# Original image value: URL, inline SVG or HTML, or base64 data URI.
#
# @return [String]
required :src, String

# @!attribute type
# The type/format of the src value
# Format of src.
#
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Type]
required :type, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::Image::Type }

# @!method initialize(alt:, element:, src:, type:)
# @param alt [String, nil] Alt text of the image, or null if not present
# @!attribute enrichment
# Requested metadata for images that could be processed.
#
# @param element [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Element] The HTML element the image was found in
# @return [ContextDev::Models::WebWebScrapeImagesResponse::Image::Enrichment, nil]
optional :enrichment, -> { ContextDev::Models::WebWebScrapeImagesResponse::Image::Enrichment }

# @!method initialize(alt:, element:, src:, type:, enrichment: nil)
# @param alt [String, nil] Image alt text, or null when unavailable.
#
# @param element [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Element] Where the image was found.
#
# @param src [String] Original image value: URL, inline SVG or HTML, or base64 data URI.
#
# @param src [String] The image source - can be a URL, inline HTML (for SVGs), or a base64 data URI
# @param type [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Type] Format of src.
#
# @param type [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Type] The type/format of the src value
# @param enrichment [ContextDev::Models::WebWebScrapeImagesResponse::Image::Enrichment] Requested metadata for images that could be processed.

# The HTML element the image was found in
# Where the image was found.
#
# @see ContextDev::Models::WebWebScrapeImagesResponse::Image#element
module Element
Expand All @@ -84,7 +92,7 @@ module Element
# @return [Array<Symbol>]
end

# The type/format of the src value
# Format of src.
#
# @see ContextDev::Models::WebWebScrapeImagesResponse::Image#type
module Type
Expand All @@ -97,9 +105,74 @@ module Type
# @!method self.values
# @return [Array<Symbol>]
end

# @see ContextDev::Models::WebWebScrapeImagesResponse::Image#enrichment
class Enrichment < ContextDev::Internal::Type::BaseModel
# @!attribute height
# Image height in pixels, when measured.
#
# @return [Integer, nil]
optional :height, Integer

# @!attribute mimetype
# Detected MIME type, when hosted.
#
# @return [String, nil]
optional :mimetype, String

# @!attribute type
# Visual asset category, when classified.
#
# @return [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Enrichment::Type, nil]
optional :type, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::Image::Enrichment::Type }

# @!attribute url
# Brand.dev CDN URL, when hosted.
#
# @return [String, nil]
optional :url, String

# @!attribute width
# Image width in pixels, when measured.
#
# @return [Integer, nil]
optional :width, Integer

# @!method initialize(height: nil, mimetype: nil, type: nil, url: nil, width: nil)
# Requested metadata for images that could be processed.
#
# @param height [Integer] Image height in pixels, when measured.
#
# @param mimetype [String] Detected MIME type, when hosted.
#
# @param type [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::Image::Enrichment::Type] Visual asset category, when classified.
#
# @param url [String] Brand.dev CDN URL, when hosted.
#
# @param width [Integer] Image width in pixels, when measured.

# Visual asset category, when classified.
#
# @see ContextDev::Models::WebWebScrapeImagesResponse::Image::Enrichment#type
module Type
extend ContextDev::Internal::Type::Enum

PHOTOGRAPHY = :photography
ILLUSTRATION = :illustration
LOGO = :logo
WORDMARK = :wordmark
ICON = :icon
PATTERN = :pattern
GRAPHIC = :graphic
OTHER = :other

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

# Indicates success
# Always true on success.
#
# @see ContextDev::Models::WebWebScrapeImagesResponse#success
module Success
Expand Down
20 changes: 14 additions & 6 deletions lib/context_dev/resources/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,21 @@ def web_scrape_html(params)
)
end

# Scrapes all images from the given URL. Extracts images from img, svg,
# picture/source, link, and video elements including inline SVGs, base64 data
# URIs, and standard URLs.
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebScrapeImagesParams} for more details.
#
# Extract image assets from a web page, including standard URLs, inline SVGs, data
# URIs, responsive image sources, metadata, CSS backgrounds, video posters, and
# embeds. The base request costs 1 credit; enrichment costs 1 credit per returned
# image.
#
# @overload web_scrape_images(url:, enrichment: nil, max_age_ms: nil, request_options: {})
#
# @param url [String] Page URL to inspect. Must include http:// or https://.
#
# @overload web_scrape_images(url:, request_options: {})
# @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme
#
# @param url [String] Full URL to scrape images from (must include http:// or https:// protocol)
# @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
#
Expand All @@ -202,7 +210,7 @@ def web_scrape_images(params)
@client.request(
method: :get,
path: "web/scrape/images",
query: query,
query: query.transform_keys(max_age_ms: "maxAgeMs"),
model: ContextDev::Models::WebWebScrapeImagesResponse,
options: options
)
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.13.0"
VERSION = "1.14.0"
end
Loading
Loading