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.6.0"
".": "1.7.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: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-ca8e38b0f28a9967dab631b8868f1d59bc035fd994a717e0125c77ca592bd105.yml
openapi_spec_hash: ef0a5df01201a032dcc41f9a25b733e6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-ee23a181bfa364090a90254a433704adf4d3b413730fe75e5ad9a26273ec517a.yml
openapi_spec_hash: bc99d89cb1e7cdacc997214305bffee7
config_hash: 7d13dca2b2c6f71fc463cb6062efa5ea
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.7.0 (2026-04-24)

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

### Features

* **api:** api update ([9c8b4d9](https://github.com/context-dot-dev/context-ruby-sdk/commit/9c8b4d9b1d813c5b7992998a3fa23cde63fe2f4c))

## 1.6.0 (2026-04-23)

Full Changelog: [v1.5.0...v1.6.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.5.0...v1.6.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.6.0)
context.dev (1.7.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.6.0"
gem "context.dev", "~> 1.7.0"
```

<!-- x-release-please-end -->
Expand Down
12 changes: 11 additions & 1 deletion lib/context_dev/models/web_web_crawl_md_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
# @return [Integer, nil]
optional :max_pages, Integer, api_name: :maxPages

# @!attribute parse_pdf
# When true (default), PDF pages are fetched and their text layer is extracted and
# converted to Markdown alongside HTML pages. When false, PDF pages are skipped
# entirely (not included in results and not counted as failures).
#
# @return [Boolean, nil]
optional :parse_pdf, ContextDev::Internal::Type::Boolean, api_name: :parsePDF

# @!attribute shorten_base64_images
# Truncate base64-encoded image data in the Markdown output
#
Expand All @@ -72,7 +80,7 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
# @return [Boolean, nil]
optional :use_main_content_only, ContextDev::Internal::Type::Boolean, api_name: :useMainContentOnly

# @!method initialize(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
# @!method initialize(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebCrawlMdParams} for more details.
#
Expand All @@ -90,6 +98,8 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel
#
# @param max_pages [Integer] Maximum number of pages to crawl. Hard cap: 500.
#
# @param parse_pdf [Boolean] When true (default), PDF pages are fetched and their text layer is extracted and
#
# @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output
#
# @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped.
Expand Down
13 changes: 12 additions & 1 deletion lib/context_dev/models/web_web_crawl_md_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class Metadata < ContextDev::Internal::Type::BaseModel
# @return [Integer]
required :num_failed, Integer, api_name: :numFailed

# @!attribute num_skipped
# Number of URLs skipped (PDFs when parsePDF=false, or URLs not matching urlRegex)
#
# @return [Integer]
required :num_skipped, Integer, api_name: :numSkipped

# @!attribute num_succeeded
# Number of pages successfully crawled
#
Expand All @@ -45,11 +51,16 @@ class Metadata < ContextDev::Internal::Type::BaseModel
# @return [Integer]
required :num_urls, Integer, api_name: :numUrls

# @!method initialize(max_crawl_depth:, num_failed:, num_succeeded:, num_urls:)
# @!method initialize(max_crawl_depth:, num_failed:, num_skipped:, num_succeeded:, num_urls:)
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebCrawlMdResponse::Metadata} for more details.
#
# @param max_crawl_depth [Integer] Maximum crawl depth reached during the crawl
#
# @param num_failed [Integer] Number of pages that failed to crawl
#
# @param num_skipped [Integer] Number of URLs skipped (PDFs when parsePDF=false, or URLs not matching urlRegex)
#
# @param num_succeeded [Integer] Number of pages successfully crawled
#
# @param num_urls [Integer] Total number of URLs crawled
Expand Down
12 changes: 11 additions & 1 deletion lib/context_dev/models/web_web_scrape_html_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,24 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel
# @return [Integer, nil]
optional :max_age_ms, Integer

# @!method initialize(url:, max_age_ms: nil, request_options: {})
# @!attribute parse_pdf
# When true (default), PDF URLs are fetched and their text layer is extracted and
# returned wrapped in <html><pdf>…</pdf></html>. When false, PDF URLs are skipped
# and a 400 WEBSITE_ACCESS_ERROR is returned.
#
# @return [Boolean, nil]
optional :parse_pdf, ContextDev::Internal::Type::Boolean

# @!method initialize(url:, max_age_ms: nil, parse_pdf: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
#
# @param url [String] Full URL to scrape (must include http:// or https:// protocol)
#
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
#
# @param parse_pdf [Boolean] When true (default), PDF URLs are fetched and their text layer is extracted and
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
end
end
Expand Down
12 changes: 11 additions & 1 deletion lib/context_dev/models/web_web_scrape_md_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel
# @return [Integer, nil]
optional :max_age_ms, Integer

# @!attribute parse_pdf
# When true (default), PDF URLs are fetched and their text layer is extracted and
# converted to Markdown. When false, PDF URLs are skipped and a 400
# WEBSITE_ACCESS_ERROR is returned.
#
# @return [Boolean, nil]
optional :parse_pdf, ContextDev::Internal::Type::Boolean

# @!attribute shorten_base64_images
# Shorten base64-encoded image data in the Markdown output
#
Expand All @@ -47,7 +55,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel
# @return [Boolean, nil]
optional :use_main_content_only, ContextDev::Internal::Type::Boolean

# @!method initialize(url:, include_images: nil, include_links: nil, max_age_ms: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
# @!method initialize(url:, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {ContextDev::Models::WebWebScrapeMdParams} for more details.
#
Expand All @@ -59,6 +67,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel
#
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
#
# @param parse_pdf [Boolean] When true (default), PDF URLs are fetched and their text layer is extracted and
#
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
#
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
Expand Down
15 changes: 11 additions & 4 deletions lib/context_dev/resources/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def screenshot(params = {})
# Performs a crawl starting from a given URL, extracts page content as Markdown,
# and returns results for all crawled pages.
#
# @overload web_crawl_md(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
# @overload web_crawl_md(url:, follow_subdomains: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, url_regex: nil, use_main_content_only: nil, request_options: {})
#
# @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
#
Expand All @@ -121,6 +121,8 @@ def screenshot(params = {})
#
# @param max_pages [Integer] Maximum number of pages to crawl. Hard cap: 500.
#
# @param parse_pdf [Boolean] When true (default), PDF pages are fetched and their text layer is extracted and
#
# @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output
#
# @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped.
Expand Down Expand Up @@ -148,12 +150,14 @@ def web_crawl_md(params)
#
# Scrapes the given URL and returns the raw HTML content of the page.
#
# @overload web_scrape_html(url:, max_age_ms: nil, request_options: {})
# @overload web_scrape_html(url:, max_age_ms: nil, parse_pdf: nil, request_options: {})
#
# @param url [String] Full URL to scrape (must include http:// or https:// protocol)
#
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
#
# @param parse_pdf [Boolean] When true (default), PDF URLs are fetched and their text layer is extracted and
#
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [ContextDev::Models::WebWebScrapeHTMLResponse]
Expand All @@ -165,7 +169,7 @@ def web_scrape_html(params)
@client.request(
method: :get,
path: "web/scrape/html",
query: query.transform_keys(max_age_ms: "maxAgeMs"),
query: query.transform_keys(max_age_ms: "maxAgeMs", parse_pdf: "parsePDF"),
model: ContextDev::Models::WebWebScrapeHTMLResponse,
options: options
)
Expand Down Expand Up @@ -201,7 +205,7 @@ def web_scrape_images(params)
#
# Scrapes the given URL into LLM usable Markdown.
#
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, max_age_ms: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
# @overload web_scrape_md(url:, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
#
# @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
#
Expand All @@ -211,6 +215,8 @@ def web_scrape_images(params)
#
# @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
#
# @param parse_pdf [Boolean] When true (default), PDF URLs are fetched and their text layer is extracted and
#
# @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
#
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
Expand All @@ -230,6 +236,7 @@ def web_scrape_md(params)
include_images: "includeImages",
include_links: "includeLinks",
max_age_ms: "maxAgeMs",
parse_pdf: "parsePDF",
shorten_base64_images: "shortenBase64Images",
use_main_content_only: "useMainContentOnly"
),
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.6.0"
VERSION = "1.7.0"
end
15 changes: 15 additions & 0 deletions rbi/context_dev/models/web_web_crawl_md_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ module ContextDev
sig { params(max_pages: Integer).void }
attr_writer :max_pages

# When true (default), PDF pages are fetched and their text layer is extracted and
# converted to Markdown alongside HTML pages. When false, PDF pages are skipped
# entirely (not included in results and not counted as failures).
sig { returns(T.nilable(T::Boolean)) }
attr_reader :parse_pdf

sig { params(parse_pdf: T::Boolean).void }
attr_writer :parse_pdf

# Truncate base64-encoded image data in the Markdown output
sig { returns(T.nilable(T::Boolean)) }
attr_reader :shorten_base64_images
Expand Down Expand Up @@ -92,6 +101,7 @@ module ContextDev
max_age_ms: Integer,
max_depth: Integer,
max_pages: Integer,
parse_pdf: T::Boolean,
shorten_base64_images: T::Boolean,
url_regex: String,
use_main_content_only: T::Boolean,
Expand All @@ -117,6 +127,10 @@ module ContextDev
max_depth: nil,
# Maximum number of pages to crawl. Hard cap: 500.
max_pages: nil,
# When true (default), PDF pages are fetched and their text layer is extracted and
# converted to Markdown alongside HTML pages. When false, PDF pages are skipped
# entirely (not included in results and not counted as failures).
parse_pdf: nil,
# Truncate base64-encoded image data in the Markdown output
shorten_base64_images: nil,
# Regex pattern. Only URLs matching this pattern will be followed and scraped.
Expand All @@ -138,6 +152,7 @@ module ContextDev
max_age_ms: Integer,
max_depth: Integer,
max_pages: Integer,
parse_pdf: T::Boolean,
shorten_base64_images: T::Boolean,
url_regex: String,
use_main_content_only: T::Boolean,
Expand Down
8 changes: 8 additions & 0 deletions rbi/context_dev/models/web_web_crawl_md_response.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ module ContextDev
sig { returns(Integer) }
attr_accessor :num_failed

# Number of URLs skipped (PDFs when parsePDF=false, or URLs not matching urlRegex)
sig { returns(Integer) }
attr_accessor :num_skipped

# Number of pages successfully crawled
sig { returns(Integer) }
attr_accessor :num_succeeded
Expand All @@ -76,6 +80,7 @@ module ContextDev
params(
max_crawl_depth: Integer,
num_failed: Integer,
num_skipped: Integer,
num_succeeded: Integer,
num_urls: Integer
).returns(T.attached_class)
Expand All @@ -85,6 +90,8 @@ module ContextDev
max_crawl_depth:,
# Number of pages that failed to crawl
num_failed:,
# Number of URLs skipped (PDFs when parsePDF=false, or URLs not matching urlRegex)
num_skipped:,
# Number of pages successfully crawled
num_succeeded:,
# Total number of URLs crawled
Expand All @@ -97,6 +104,7 @@ module ContextDev
{
max_crawl_depth: Integer,
num_failed: Integer,
num_skipped: Integer,
num_succeeded: Integer,
num_urls: Integer
}
Expand Down
15 changes: 15 additions & 0 deletions rbi/context_dev/models/web_web_scrape_html_params.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@ module ContextDev
sig { params(max_age_ms: Integer).void }
attr_writer :max_age_ms

# When true (default), PDF URLs are fetched and their text layer is extracted and
# returned wrapped in <html><pdf>…</pdf></html>. When false, PDF URLs are skipped
# and a 400 WEBSITE_ACCESS_ERROR is returned.
sig { returns(T.nilable(T::Boolean)) }
attr_reader :parse_pdf

sig { params(parse_pdf: T::Boolean).void }
attr_writer :parse_pdf

sig do
params(
url: String,
max_age_ms: Integer,
parse_pdf: T::Boolean,
request_options: ContextDev::RequestOptions::OrHash
).returns(T.attached_class)
end
Expand All @@ -41,6 +51,10 @@ module ContextDev
# younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
max_age_ms: nil,
# When true (default), PDF URLs are fetched and their text layer is extracted and
# returned wrapped in <html><pdf>…</pdf></html>. When false, PDF URLs are skipped
# and a 400 WEBSITE_ACCESS_ERROR is returned.
parse_pdf: nil,
request_options: {}
)
end
Expand All @@ -50,6 +64,7 @@ module ContextDev
{
url: String,
max_age_ms: Integer,
parse_pdf: T::Boolean,
request_options: ContextDev::RequestOptions
}
)
Expand Down
Loading
Loading