From 8376344a7a72a7ff01906bc3d6a5913a4de60bcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 03:02:58 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 4 +-- .../models/ai_extract_product_params.rb | 7 ++-- .../models/ai_extract_products_params.rb | 14 ++++---- .../models/web_screenshot_params.rb | 12 ++++++- .../models/web_web_crawl_md_params.rb | 12 ++++++- .../models/web_web_scrape_html_params.rb | 12 ++++++- .../models/web_web_scrape_images_params.rb | 12 ++++++- .../models/web_web_scrape_md_params.rb | 12 ++++++- .../models/web_web_scrape_sitemap_params.rb | 12 ++++++- lib/context_dev/resources/ai.rb | 2 +- lib/context_dev/resources/web.rb | 35 +++++++++++++------ .../models/ai_extract_product_params.rbi | 10 +++--- .../models/ai_extract_products_params.rbi | 20 ++++++----- .../models/web_screenshot_params.rbi | 15 ++++++++ .../models/web_web_crawl_md_params.rbi | 15 ++++++++ .../models/web_web_scrape_html_params.rbi | 15 ++++++++ .../models/web_web_scrape_images_params.rbi | 15 ++++++++ .../models/web_web_scrape_md_params.rbi | 15 ++++++++ .../models/web_web_scrape_sitemap_params.rbi | 15 ++++++++ rbi/context_dev/resources/ai.rbi | 5 +-- rbi/context_dev/resources/web.rbi | 30 ++++++++++++++++ .../models/web_screenshot_params.rbs | 7 ++++ .../models/web_web_crawl_md_params.rbs | 7 ++++ .../models/web_web_scrape_html_params.rbs | 9 ++++- .../models/web_web_scrape_images_params.rbs | 9 ++++- .../models/web_web_scrape_md_params.rbs | 7 ++++ .../models/web_web_scrape_sitemap_params.rbs | 13 ++++++- sig/context_dev/resources/web.rbs | 6 ++++ 28 files changed, 302 insertions(+), 45 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f12b687..e845d92e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d880c25aee159e1260e23dfa3685b1bb9e35b02a1927adecbff32664ba8e11a4.yml -openapi_spec_hash: aa96a6030390bca0b4cdfa2363961807 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-e26ac226a3cf6d02380f3df386077414dd424dbf35c7c40e02ba512eff1dff84.yml +openapi_spec_hash: 077166ff05843544fbb4b519200ac9fc config_hash: 70354330f92ce169beabc98696ebb9a3 diff --git a/lib/context_dev/models/ai_extract_product_params.rb b/lib/context_dev/models/ai_extract_product_params.rb index 364bb703..8baeb3cb 100644 --- a/lib/context_dev/models/ai_extract_product_params.rb +++ b/lib/context_dev/models/ai_extract_product_params.rb @@ -22,8 +22,9 @@ class AIExtractProductParams < ContextDev::Internal::Type::BaseModel optional :max_age_ms, Integer, api_name: :maxAgeMs # @!attribute timeout_ms - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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 @@ -36,7 +37,7 @@ class AIExtractProductParams < 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 timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000 + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/context_dev/models/ai_extract_products_params.rb b/lib/context_dev/models/ai_extract_products_params.rb index 7594ddba..592a101a 100644 --- a/lib/context_dev/models/ai_extract_products_params.rb +++ b/lib/context_dev/models/ai_extract_products_params.rb @@ -45,8 +45,9 @@ class ByDomain < ContextDev::Internal::Type::BaseModel optional :max_products, Integer, api_name: :maxProducts # @!attribute timeout_ms - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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 @@ -61,7 +62,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000 + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th end class ByDirectURL < ContextDev::Internal::Type::BaseModel @@ -87,8 +88,9 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel optional :max_products, Integer, api_name: :maxProducts # @!attribute timeout_ms - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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 @@ -104,7 +106,7 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000 + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th end # @!method self.variants diff --git a/lib/context_dev/models/web_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb index 661953af..52a13b08 100644 --- a/lib/context_dev/models/web_screenshot_params.rb +++ b/lib/context_dev/models/web_screenshot_params.rb @@ -57,13 +57,21 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize, nil] optional :prioritize, enum: -> { ContextDev::WebScreenshotParams::Prioritize } + # @!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 + # @!attribute viewport # Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. # # @return [ContextDev::Models::WebScreenshotParams::Viewport, nil] optional :viewport, -> { ContextDev::WebScreenshotParams::Viewport } - # @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, viewport: nil, request_options: {}) + # @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, timeout_ms: nil, viewport: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebScreenshotParams} for more details. # @@ -79,6 +87,8 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/web_web_crawl_md_params.rb b/lib/context_dev/models/web_web_crawl_md_params.rb index 87e3c19e..56f11010 100644 --- a/lib/context_dev/models/web_web_crawl_md_params.rb +++ b/lib/context_dev/models/web_web_crawl_md_params.rb @@ -74,6 +74,14 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :shorten_base64_images, ContextDev::Internal::Type::Boolean, api_name: :shortenBase64Images + # @!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 url_regex # Regex pattern. Only URLs matching this pattern will be followed and scraped. # @@ -87,7 +95,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_frames: 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: {}) + # @!method initialize(url:, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebCrawlMdParams} for more details. # @@ -111,6 +119,8 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # # @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. # # @param use_main_content_only [Boolean] Extract only the main content, stripping headers, footers, sidebars, and navigat diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index cc5373d0..778dc78e 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -35,7 +35,15 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :parse_pdf, ContextDev::Internal::Type::Boolean - # @!method initialize(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, request_options: {}) + # @!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 + + # @!method initialize(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. # @@ -47,6 +55,8 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # # @param parse_pdf [Boolean] When true (default), PDF URLs are fetched and their text layer is extracted and # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/context_dev/models/web_web_scrape_images_params.rb b/lib/context_dev/models/web_web_scrape_images_params.rb index 3a3663a2..d51694be 100644 --- a/lib/context_dev/models/web_web_scrape_images_params.rb +++ b/lib/context_dev/models/web_web_scrape_images_params.rb @@ -27,7 +27,15 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_age_ms, Integer - # @!method initialize(url:, enrichment: nil, max_age_ms: nil, request_options: {}) + # @!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 + + # @!method initialize(url:, enrichment: nil, max_age_ms: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeImagesParams} for more details. # @@ -37,6 +45,8 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] class Enrichment < ContextDev::Internal::Type::BaseModel diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index 572e6aeb..9a0e2951 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -54,6 +54,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :shorten_base64_images, ContextDev::Internal::Type::Boolean + # @!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 + # @!attribute use_main_content_only # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation @@ -61,7 +69,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :use_main_content_only, ContextDev::Internal::Type::Boolean - # @!method initialize(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) + # @!method initialize(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # @@ -79,6 +87,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/web_web_scrape_sitemap_params.rb b/lib/context_dev/models/web_web_scrape_sitemap_params.rb index f6db1719..ff3c91bc 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_params.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_params.rb @@ -20,6 +20,14 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_links, Integer + # @!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 + # @!attribute url_regex # Optional RE2-compatible regex pattern. Only URLs matching this pattern are # returned and counted against maxLinks. @@ -27,7 +35,7 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [String, nil] optional :url_regex, String - # @!method initialize(domain:, max_links: nil, url_regex: nil, request_options: {}) + # @!method initialize(domain:, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # @@ -35,6 +43,8 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/resources/ai.rb b/lib/context_dev/resources/ai.rb index f604cbb8..bd295fbd 100644 --- a/lib/context_dev/resources/ai.rb +++ b/lib/context_dev/resources/ai.rb @@ -48,7 +48,7 @@ def ai_query(params) # # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y # - # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. Maximum allowed value is 30000 + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index b3367348..86414953 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -70,7 +70,7 @@ def extract_styleguide(params = {}) # # Capture a screenshot of a website. # - # @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, viewport: nil, request_options: {}) + # @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, timeout_ms: nil, viewport: nil, request_options: {}) # # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https # @@ -84,6 +84,8 @@ def extract_styleguide(params = {}) # # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -100,7 +102,8 @@ def screenshot(params = {}) query: query.transform_keys( direct_url: "directUrl", full_screenshot: "fullScreenshot", - max_age_ms: "maxAgeMs" + max_age_ms: "maxAgeMs", + timeout_ms: "timeoutMS" ), model: ContextDev::Models::WebScreenshotResponse, options: options @@ -113,7 +116,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_frames: 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: {}) + # @overload web_crawl_md(url:, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: 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) # @@ -135,6 +138,8 @@ def screenshot(params = {}) # # @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. # # @param use_main_content_only [Boolean] Extract only the main content, stripping headers, footers, sidebars, and navigat @@ -160,7 +165,7 @@ def web_crawl_md(params) # # Scrapes the given URL and returns the raw HTML content of the page. # - # @overload web_scrape_html(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, request_options: {}) + # @overload web_scrape_html(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, timeout_ms: nil, request_options: {}) # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # @@ -170,6 +175,8 @@ def web_crawl_md(params) # # @param parse_pdf [Boolean] When true (default), PDF URLs are fetched and their text layer is extracted and # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeHTMLResponse] @@ -184,7 +191,8 @@ def web_scrape_html(params) query: query.transform_keys( include_frames: "includeFrames", max_age_ms: "maxAgeMs", - parse_pdf: "parsePDF" + parse_pdf: "parsePDF", + timeout_ms: "timeoutMS" ), model: ContextDev::Models::WebWebScrapeHTMLResponse, options: options @@ -199,7 +207,7 @@ def web_scrape_html(params) # 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: {}) + # @overload web_scrape_images(url:, enrichment: nil, max_age_ms: nil, timeout_ms: nil, request_options: {}) # # @param url [String] Page URL to inspect. Must include http:// or https://. # @@ -207,6 +215,8 @@ def web_scrape_html(params) # # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeImagesResponse] @@ -218,7 +228,7 @@ def web_scrape_images(params) @client.request( method: :get, path: "web/scrape/images", - query: query.transform_keys(max_age_ms: "maxAgeMs"), + query: query.transform_keys(max_age_ms: "maxAgeMs", timeout_ms: "timeoutMS"), model: ContextDev::Models::WebWebScrapeImagesResponse, options: options ) @@ -229,7 +239,7 @@ def web_scrape_images(params) # # Scrapes the given URL into LLM usable Markdown. # - # @overload web_scrape_md(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) + # @overload web_scrape_md(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: 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 # @@ -245,6 +255,8 @@ def web_scrape_images(params) # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -265,6 +277,7 @@ def web_scrape_md(params) max_age_ms: "maxAgeMs", parse_pdf: "parsePDF", shorten_base64_images: "shortenBase64Images", + timeout_ms: "timeoutMS", use_main_content_only: "useMainContentOnly" ), model: ContextDev::Models::WebWebScrapeMdResponse, @@ -277,12 +290,14 @@ def web_scrape_md(params) # # Crawl an entire website's sitemap and return all discovered page URLs. # - # @overload web_scrape_sitemap(domain:, max_links: nil, url_regex: nil, request_options: {}) + # @overload web_scrape_sitemap(domain:, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {}) # # @param domain [String] Domain to build a sitemap for # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th + # # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -296,7 +311,7 @@ def web_scrape_sitemap(params) @client.request( method: :get, path: "web/scrape/sitemap", - query: query.transform_keys(max_links: "maxLinks", url_regex: "urlRegex"), + query: query.transform_keys(max_links: "maxLinks", timeout_ms: "timeoutMS", url_regex: "urlRegex"), model: ContextDev::Models::WebWebScrapeSitemapResponse, options: options ) diff --git a/rbi/context_dev/models/ai_extract_product_params.rbi b/rbi/context_dev/models/ai_extract_product_params.rbi index 669ed76c..ef6e788d 100644 --- a/rbi/context_dev/models/ai_extract_product_params.rbi +++ b/rbi/context_dev/models/ai_extract_product_params.rbi @@ -27,8 +27,9 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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). sig { returns(T.nilable(Integer)) } attr_reader :timeout_ms @@ -50,8 +51,9 @@ module ContextDev # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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). timeout_ms: nil, request_options: {} ) diff --git a/rbi/context_dev/models/ai_extract_products_params.rbi b/rbi/context_dev/models/ai_extract_products_params.rbi index 4976fae8..3e81df18 100644 --- a/rbi/context_dev/models/ai_extract_products_params.rbi +++ b/rbi/context_dev/models/ai_extract_products_params.rbi @@ -92,8 +92,9 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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). sig { returns(T.nilable(Integer)) } attr_reader :timeout_ms @@ -117,8 +118,9 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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). timeout_ms: nil ) end @@ -167,8 +169,9 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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). sig { returns(T.nilable(Integer)) } attr_reader :timeout_ms @@ -193,8 +196,9 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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). timeout_ms: nil ) end diff --git a/rbi/context_dev/models/web_screenshot_params.rbi b/rbi/context_dev/models/web_screenshot_params.rbi index eb65d5d3..f2f38690 100644 --- a/rbi/context_dev/models/web_screenshot_params.rbi +++ b/rbi/context_dev/models/web_screenshot_params.rbi @@ -86,6 +86,15 @@ module ContextDev end attr_writer :prioritize + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + # Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. sig { returns(T.nilable(ContextDev::WebScreenshotParams::Viewport)) } attr_reader :viewport @@ -104,6 +113,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, + timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -135,6 +145,10 @@ module ContextDev # faster capture with basic quality. If 'quality', optimizes for higher quality # with longer wait times. Defaults to 'quality' if not provided. prioritize: nil, + # 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). + timeout_ms: nil, # Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. viewport: nil, request_options: {} @@ -151,6 +165,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, + timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/web_web_crawl_md_params.rbi b/rbi/context_dev/models/web_web_crawl_md_params.rbi index 1007f855..75bb922f 100644 --- a/rbi/context_dev/models/web_web_crawl_md_params.rbi +++ b/rbi/context_dev/models/web_web_crawl_md_params.rbi @@ -85,6 +85,15 @@ module ContextDev sig { params(shorten_base64_images: T::Boolean).void } attr_writer :shorten_base64_images + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + # Regex pattern. Only URLs matching this pattern will be followed and scraped. sig { returns(T.nilable(String)) } attr_reader :url_regex @@ -112,6 +121,7 @@ module ContextDev max_pages: Integer, parse_pdf: T::Boolean, shorten_base64_images: T::Boolean, + timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash @@ -145,6 +155,10 @@ module ContextDev parse_pdf: nil, # Truncate base64-encoded image data in the Markdown output shorten_base64_images: nil, + # 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). + timeout_ms: nil, # Regex pattern. Only URLs matching this pattern will be followed and scraped. url_regex: nil, # Extract only the main content, stripping headers, footers, sidebars, and @@ -167,6 +181,7 @@ module ContextDev max_pages: Integer, parse_pdf: T::Boolean, shorten_base64_images: T::Boolean, + timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index 36bb79b6..e09e2d55 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -43,12 +43,22 @@ module ContextDev sig { params(parse_pdf: T::Boolean).void } attr_writer :parse_pdf + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + sig do params( url: String, include_frames: T::Boolean, max_age_ms: Integer, parse_pdf: T::Boolean, + timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -65,6 +75,10 @@ module ContextDev # returned wrapped in …. When false, PDF URLs are skipped # and a 400 WEBSITE_ACCESS_ERROR is returned. parse_pdf: nil, + # 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). + timeout_ms: nil, request_options: {} ) end @@ -76,6 +90,7 @@ module ContextDev include_frames: T::Boolean, max_age_ms: Integer, parse_pdf: T::Boolean, + timeout_ms: Integer, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/models/web_web_scrape_images_params.rbi b/rbi/context_dev/models/web_web_scrape_images_params.rbi index 12d4a5e7..0ff00e44 100644 --- a/rbi/context_dev/models/web_web_scrape_images_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_images_params.rbi @@ -40,11 +40,21 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + sig do params( url: String, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, max_age_ms: Integer, + timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -57,6 +67,10 @@ module ContextDev # Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). max_age_ms: nil, + # 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). + timeout_ms: nil, request_options: {} ) end @@ -67,6 +81,7 @@ module ContextDev url: String, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, max_age_ms: Integer, + timeout_ms: Integer, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index d555cbfd..1510807c 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -62,6 +62,15 @@ module ContextDev sig { params(shorten_base64_images: T::Boolean).void } attr_writer :shorten_base64_images + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation sig { returns(T.nilable(T::Boolean)) } @@ -79,6 +88,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: T::Boolean, shorten_base64_images: T::Boolean, + timeout_ms: Integer, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -103,6 +113,10 @@ module ContextDev parse_pdf: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # 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). + timeout_ms: nil, # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation use_main_content_only: nil, @@ -120,6 +134,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: T::Boolean, shorten_base64_images: T::Boolean, + timeout_ms: Integer, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi index ad158a45..d71d0c53 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi @@ -26,6 +26,15 @@ module ContextDev sig { params(max_links: Integer).void } attr_writer :max_links + # 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). + sig { returns(T.nilable(Integer)) } + attr_reader :timeout_ms + + sig { params(timeout_ms: Integer).void } + attr_writer :timeout_ms + # Optional RE2-compatible regex pattern. Only URLs matching this pattern are # returned and counted against maxLinks. sig { returns(T.nilable(String)) } @@ -38,6 +47,7 @@ module ContextDev params( domain: String, max_links: Integer, + timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -48,6 +58,10 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # 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). + timeout_ms: nil, # Optional RE2-compatible regex pattern. Only URLs matching this pattern are # returned and counted against maxLinks. url_regex: nil, @@ -60,6 +74,7 @@ module ContextDev { domain: String, max_links: Integer, + timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/resources/ai.rbi b/rbi/context_dev/resources/ai.rbi index dc103d43..d8382cd7 100644 --- a/rbi/context_dev/resources/ai.rbi +++ b/rbi/context_dev/resources/ai.rbi @@ -48,8 +48,9 @@ module ContextDev # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, - # Optional timeout in milliseconds for the request. Maximum allowed value is - # 300000ms (5 minutes). + # 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). timeout_ms: nil, request_options: {} ) diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 0e6cd5e2..df082354 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -68,6 +68,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, + timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebScreenshotResponse) @@ -99,6 +100,10 @@ module ContextDev # faster capture with basic quality. If 'quality', optimizes for higher quality # with longer wait times. Defaults to 'quality' if not provided. prioritize: nil, + # 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). + timeout_ms: nil, # Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. viewport: nil, request_options: {} @@ -119,6 +124,7 @@ module ContextDev max_pages: Integer, parse_pdf: T::Boolean, shorten_base64_images: T::Boolean, + timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash @@ -152,6 +158,10 @@ module ContextDev parse_pdf: nil, # Truncate base64-encoded image data in the Markdown output shorten_base64_images: nil, + # 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). + timeout_ms: nil, # Regex pattern. Only URLs matching this pattern will be followed and scraped. url_regex: nil, # Extract only the main content, stripping headers, footers, sidebars, and @@ -168,6 +178,7 @@ module ContextDev include_frames: T::Boolean, max_age_ms: Integer, parse_pdf: T::Boolean, + timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeHTMLResponse) end @@ -184,6 +195,10 @@ module ContextDev # returned wrapped in …. When false, PDF URLs are skipped # and a 400 WEBSITE_ACCESS_ERROR is returned. parse_pdf: nil, + # 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). + timeout_ms: nil, request_options: {} ) end @@ -197,6 +212,7 @@ module ContextDev url: String, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, max_age_ms: Integer, + timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeImagesResponse) end @@ -209,6 +225,10 @@ module ContextDev # Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). max_age_ms: nil, + # 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). + timeout_ms: nil, request_options: {} ) end @@ -223,6 +243,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: T::Boolean, shorten_base64_images: T::Boolean, + timeout_ms: Integer, use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeMdResponse) @@ -247,6 +268,10 @@ module ContextDev parse_pdf: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # 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). + timeout_ms: nil, # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation use_main_content_only: nil, @@ -259,6 +284,7 @@ module ContextDev params( domain: String, max_links: Integer, + timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeSitemapResponse) @@ -269,6 +295,10 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # 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). + timeout_ms: nil, # Optional RE2-compatible regex pattern. Only URLs matching this pattern are # returned and counted against maxLinks. url_regex: nil, diff --git a/sig/context_dev/models/web_screenshot_params.rbs b/sig/context_dev/models/web_screenshot_params.rbs index 1f9de9a0..a5b26837 100644 --- a/sig/context_dev/models/web_screenshot_params.rbs +++ b/sig/context_dev/models/web_screenshot_params.rbs @@ -8,6 +8,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::Models::WebScreenshotParams::page, prioritize: ContextDev::Models::WebScreenshotParams::prioritize, + timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport } & ContextDev::Internal::Type::request_parameters @@ -46,6 +47,10 @@ module ContextDev ContextDev::Models::WebScreenshotParams::prioritize ) -> ContextDev::Models::WebScreenshotParams::prioritize + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + attr_reader viewport: ContextDev::WebScreenshotParams::Viewport? def viewport=: ( @@ -59,6 +64,7 @@ module ContextDev ?max_age_ms: Integer, ?page: ContextDev::Models::WebScreenshotParams::page, ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, + ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, ?request_options: ContextDev::request_opts ) -> void @@ -70,6 +76,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::Models::WebScreenshotParams::page, prioritize: ContextDev::Models::WebScreenshotParams::prioritize, + timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_web_crawl_md_params.rbs b/sig/context_dev/models/web_web_crawl_md_params.rbs index 56505674..3235043d 100644 --- a/sig/context_dev/models/web_web_crawl_md_params.rbs +++ b/sig/context_dev/models/web_web_crawl_md_params.rbs @@ -12,6 +12,7 @@ module ContextDev max_pages: Integer, parse_pdf: bool, :shorten_base64_images => bool, + timeout_ms: Integer, url_regex: String, use_main_content_only: bool } @@ -59,6 +60,10 @@ module ContextDev def shorten_base64_images=: (bool) -> bool + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + attr_reader url_regex: String? def url_regex=: (String) -> String @@ -78,6 +83,7 @@ module ContextDev ?max_pages: Integer, ?parse_pdf: bool, ?shorten_base64_images: bool, + ?timeout_ms: Integer, ?url_regex: String, ?use_main_content_only: bool, ?request_options: ContextDev::request_opts @@ -94,6 +100,7 @@ module ContextDev max_pages: Integer, parse_pdf: bool, :shorten_base64_images => bool, + timeout_ms: Integer, url_regex: String, use_main_content_only: bool, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/models/web_web_scrape_html_params.rbs b/sig/context_dev/models/web_web_scrape_html_params.rbs index a1ad7e0b..34e594d7 100644 --- a/sig/context_dev/models/web_web_scrape_html_params.rbs +++ b/sig/context_dev/models/web_web_scrape_html_params.rbs @@ -5,7 +5,8 @@ module ContextDev url: String, include_frames: bool, max_age_ms: Integer, - parse_pdf: bool + parse_pdf: bool, + timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -27,11 +28,16 @@ module ContextDev def parse_pdf=: (bool) -> bool + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + def initialize: ( url: String, ?include_frames: bool, ?max_age_ms: Integer, ?parse_pdf: bool, + ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -40,6 +46,7 @@ module ContextDev include_frames: bool, max_age_ms: Integer, parse_pdf: bool, + timeout_ms: Integer, request_options: ContextDev::RequestOptions } end diff --git a/sig/context_dev/models/web_web_scrape_images_params.rbs b/sig/context_dev/models/web_web_scrape_images_params.rbs index 9fea33f5..e1f4434b 100644 --- a/sig/context_dev/models/web_web_scrape_images_params.rbs +++ b/sig/context_dev/models/web_web_scrape_images_params.rbs @@ -4,7 +4,8 @@ module ContextDev { url: String, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, - max_age_ms: Integer + max_age_ms: Integer, + timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -24,10 +25,15 @@ module ContextDev def max_age_ms=: (Integer) -> Integer + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + def initialize: ( url: String, ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, ?max_age_ms: Integer, + ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -35,6 +41,7 @@ module ContextDev url: String, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, max_age_ms: Integer, + timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index 7c53b008..0bf89526 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -9,6 +9,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: bool, :shorten_base64_images => bool, + timeout_ms: Integer, use_main_content_only: bool } & ContextDev::Internal::Type::request_parameters @@ -43,6 +44,10 @@ module ContextDev def shorten_base64_images=: (bool) -> bool + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + attr_reader use_main_content_only: bool? def use_main_content_only=: (bool) -> bool @@ -55,6 +60,7 @@ module ContextDev ?max_age_ms: Integer, ?parse_pdf: bool, ?shorten_base64_images: bool, + ?timeout_ms: Integer, ?use_main_content_only: bool, ?request_options: ContextDev::request_opts ) -> void @@ -67,6 +73,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: bool, :shorten_base64_images => bool, + timeout_ms: Integer, use_main_content_only: bool, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs index bc00055c..a01a1e20 100644 --- a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +++ b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs @@ -1,7 +1,12 @@ module ContextDev module Models type web_web_scrape_sitemap_params = - { domain: String, max_links: Integer, url_regex: String } + { + domain: String, + max_links: Integer, + timeout_ms: Integer, + url_regex: String + } & ContextDev::Internal::Type::request_parameters class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel @@ -14,6 +19,10 @@ module ContextDev def max_links=: (Integer) -> Integer + attr_reader timeout_ms: Integer? + + def timeout_ms=: (Integer) -> Integer + attr_reader url_regex: String? def url_regex=: (String) -> String @@ -21,6 +30,7 @@ module ContextDev def initialize: ( domain: String, ?max_links: Integer, + ?timeout_ms: Integer, ?url_regex: String, ?request_options: ContextDev::request_opts ) -> void @@ -28,6 +38,7 @@ module ContextDev def to_hash: -> { domain: String, max_links: Integer, + timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 42eea19d..057f66e6 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -22,6 +22,7 @@ module ContextDev ?max_age_ms: Integer, ?page: ContextDev::Models::WebScreenshotParams::page, ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, + ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebScreenshotResponse @@ -37,6 +38,7 @@ module ContextDev ?max_pages: Integer, ?parse_pdf: bool, ?shorten_base64_images: bool, + ?timeout_ms: Integer, ?url_regex: String, ?use_main_content_only: bool, ?request_options: ContextDev::request_opts @@ -47,6 +49,7 @@ module ContextDev ?include_frames: bool, ?max_age_ms: Integer, ?parse_pdf: bool, + ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeHTMLResponse @@ -54,6 +57,7 @@ module ContextDev url: String, ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, ?max_age_ms: Integer, + ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeImagesResponse @@ -65,6 +69,7 @@ module ContextDev ?max_age_ms: Integer, ?parse_pdf: bool, ?shorten_base64_images: bool, + ?timeout_ms: Integer, ?use_main_content_only: bool, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeMdResponse @@ -72,6 +77,7 @@ module ContextDev def web_scrape_sitemap: ( domain: String, ?max_links: Integer, + ?timeout_ms: Integer, ?url_regex: String, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeSitemapResponse From ae638b04d0e08bf93e2cdd1211236d841d5313b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 May 2026 01:35:05 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +- .../models/web_screenshot_params.rb | 35 +++------- .../models/web_web_crawl_md_params.rb | 11 ++- .../models/web_web_scrape_html_params.rb | 11 ++- .../models/web_web_scrape_images_params.rb | 11 ++- .../models/web_web_scrape_md_params.rb | 11 ++- lib/context_dev/resources/web.rb | 37 +++++++--- .../models/web_screenshot_params.rbi | 70 ++++--------------- .../models/web_web_crawl_md_params.rbi | 13 ++++ .../models/web_web_scrape_html_params.rbi | 13 ++++ .../models/web_web_scrape_images_params.rbi | 13 ++++ .../models/web_web_scrape_md_params.rbi | 13 ++++ rbi/context_dev/resources/web.rbi | 26 +++++-- .../models/web_screenshot_params.rbs | 29 +++----- .../models/web_web_crawl_md_params.rbs | 9 ++- .../models/web_web_scrape_html_params.rbs | 9 ++- .../models/web_web_scrape_images_params.rbs | 9 ++- .../models/web_web_scrape_md_params.rbs | 9 ++- sig/context_dev/resources/web.rbs | 6 +- 19 files changed, 212 insertions(+), 127 deletions(-) diff --git a/.stats.yml b/.stats.yml index e845d92e..8baafcff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-e26ac226a3cf6d02380f3df386077414dd424dbf35c7c40e02ba512eff1dff84.yml -openapi_spec_hash: 077166ff05843544fbb4b519200ac9fc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-18e7692e180f911962f33787228afa2cf31f6c05ab23c6afb1ca4f82b108fba5.yml +openapi_spec_hash: 865bd1e346267d1e33f8ca63963c6aa3 config_hash: 70354330f92ce169beabc98696ebb9a3 diff --git a/lib/context_dev/models/web_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb index 52a13b08..29945e5d 100644 --- a/lib/context_dev/models/web_screenshot_params.rb +++ b/lib/context_dev/models/web_screenshot_params.rb @@ -49,14 +49,6 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::WebScreenshotParams::Page, nil] optional :page, enum: -> { ContextDev::WebScreenshotParams::Page } - # @!attribute prioritize - # Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - # faster capture with basic quality. If 'quality', optimizes for higher quality - # with longer wait times. Defaults to 'quality' if not provided. - # - # @return [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize, nil] - optional :prioritize, enum: -> { ContextDev::WebScreenshotParams::Prioritize } - # @!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 @@ -71,7 +63,15 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::WebScreenshotParams::Viewport, nil] optional :viewport, -> { ContextDev::WebScreenshotParams::Viewport } - # @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, timeout_ms: nil, viewport: nil, request_options: {}) + # @!attribute wait_for_ms + # Optional browser wait time in milliseconds after initial page load before taking + # the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + # omitted. + # + # @return [Integer, nil] + optional :wait_for_ms, Integer + + # @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebScreenshotParams} for more details. # @@ -85,12 +85,12 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy # - # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f - # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. # + # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before taking + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] # Optional parameter to determine screenshot type. If 'true', takes a full page @@ -127,19 +127,6 @@ module Page # @return [Array] end - # Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - # faster capture with basic quality. If 'quality', optimizes for higher quality - # with longer wait times. Defaults to 'quality' if not provided. - module Prioritize - extend ContextDev::Internal::Type::Enum - - SPEED = :speed - QUALITY = :quality - - # @!method self.values - # @return [Array] - end - class Viewport < ContextDev::Internal::Type::BaseModel # @!attribute height # Viewport height in pixels. diff --git a/lib/context_dev/models/web_web_crawl_md_params.rb b/lib/context_dev/models/web_web_crawl_md_params.rb index 56f11010..c3044f2f 100644 --- a/lib/context_dev/models/web_web_crawl_md_params.rb +++ b/lib/context_dev/models/web_web_crawl_md_params.rb @@ -95,7 +95,14 @@ 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_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, request_options: {}) + # @!attribute wait_for_ms + # Optional browser wait time in milliseconds after initial page load for each + # crawled page. Min: 0. Max: 30000 (30 seconds). + # + # @return [Integer, nil] + optional :wait_for_ms, Integer, api_name: :waitForMs + + # @!method initialize(url:, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebCrawlMdParams} for more details. # @@ -125,6 +132,8 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # # @param use_main_content_only [Boolean] Extract only the main content, stripping headers, footers, sidebars, and navigat # + # @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}] end end diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 778dc78e..615aec15 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -43,7 +43,14 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, timeout_ms: nil, request_options: {}) + # @!attribute wait_for_ms + # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + # 30000 (30 seconds). + # + # @return [Integer, nil] + optional :wait_for_ms, Integer + + # @!method initialize(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. # @@ -57,6 +64,8 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # # @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. Min: 0. Max: + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/context_dev/models/web_web_scrape_images_params.rb b/lib/context_dev/models/web_web_scrape_images_params.rb index d51694be..19ff0e25 100644 --- a/lib/context_dev/models/web_web_scrape_images_params.rb +++ b/lib/context_dev/models/web_web_scrape_images_params.rb @@ -35,7 +35,14 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(url:, enrichment: nil, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @!attribute wait_for_ms + # Optional browser wait time in milliseconds after initial page load before + # collecting images. Min: 0. Max: 30000 (30 seconds). + # + # @return [Integer, nil] + optional :wait_for_ms, Integer + + # @!method initialize(url:, enrichment: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeImagesParams} for more details. # @@ -47,6 +54,8 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # # @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 before collec + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] class Enrichment < ContextDev::Internal::Type::BaseModel diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index 9a0e2951..8f31c3f1 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -69,7 +69,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :use_main_content_only, ContextDev::Internal::Type::Boolean - # @!method initialize(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, request_options: {}) + # @!attribute wait_for_ms + # Optional browser wait time in milliseconds after initial page load before + # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + # + # @return [Integer, nil] + optional :wait_for_ms, Integer + + # @!method initialize(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # @@ -91,6 +98,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, # + # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before conver + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end end diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 86414953..6f92b0f1 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -70,7 +70,7 @@ def extract_styleguide(params = {}) # # Capture a screenshot of a website. # - # @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, timeout_ms: nil, viewport: nil, request_options: {}) + # @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) # # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https # @@ -82,12 +82,12 @@ def extract_styleguide(params = {}) # # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy # - # @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f - # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. # + # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before taking + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebScreenshotResponse] @@ -103,7 +103,8 @@ def screenshot(params = {}) direct_url: "directUrl", full_screenshot: "fullScreenshot", max_age_ms: "maxAgeMs", - timeout_ms: "timeoutMS" + timeout_ms: "timeoutMS", + wait_for_ms: "waitForMs" ), model: ContextDev::Models::WebScreenshotResponse, options: options @@ -116,7 +117,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_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, request_options: {}) + # @overload web_crawl_md(url:, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] The starting URL for the crawl (must include http:// or https:// protocol) # @@ -144,6 +145,8 @@ def screenshot(params = {}) # # @param use_main_content_only [Boolean] Extract only the main content, stripping headers, footers, sidebars, and navigat # + # @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::WebWebCrawlMdResponse] @@ -165,7 +168,7 @@ def web_crawl_md(params) # # Scrapes the given URL and returns the raw HTML content of the page. # - # @overload web_scrape_html(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, timeout_ms: nil, request_options: {}) + # @overload web_scrape_html(url:, include_frames: nil, max_age_ms: nil, parse_pdf: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # @@ -177,6 +180,8 @@ def web_crawl_md(params) # # @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. Min: 0. Max: + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeHTMLResponse] @@ -192,7 +197,8 @@ def web_scrape_html(params) include_frames: "includeFrames", max_age_ms: "maxAgeMs", parse_pdf: "parsePDF", - timeout_ms: "timeoutMS" + timeout_ms: "timeoutMS", + wait_for_ms: "waitForMs" ), model: ContextDev::Models::WebWebScrapeHTMLResponse, options: options @@ -207,7 +213,7 @@ def web_scrape_html(params) # 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, timeout_ms: nil, request_options: {}) + # @overload web_scrape_images(url:, enrichment: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] Page URL to inspect. Must include http:// or https://. # @@ -217,6 +223,8 @@ def web_scrape_html(params) # # @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 before collec + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeImagesResponse] @@ -228,7 +236,11 @@ def web_scrape_images(params) @client.request( method: :get, path: "web/scrape/images", - query: query.transform_keys(max_age_ms: "maxAgeMs", timeout_ms: "timeoutMS"), + query: query.transform_keys( + max_age_ms: "maxAgeMs", + timeout_ms: "timeoutMS", + wait_for_ms: "waitForMs" + ), model: ContextDev::Models::WebWebScrapeImagesResponse, options: options ) @@ -239,7 +251,7 @@ def web_scrape_images(params) # # Scrapes the given URL into LLM usable Markdown. # - # @overload web_scrape_md(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, request_options: {}) + # @overload web_scrape_md(url:, include_frames: nil, include_images: nil, include_links: nil, max_age_ms: nil, parse_pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # @@ -259,6 +271,8 @@ def web_scrape_images(params) # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, # + # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before conver + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeMdResponse] @@ -278,7 +292,8 @@ def web_scrape_md(params) parse_pdf: "parsePDF", shorten_base64_images: "shortenBase64Images", timeout_ms: "timeoutMS", - use_main_content_only: "useMainContentOnly" + use_main_content_only: "useMainContentOnly", + wait_for_ms: "waitForMs" ), model: ContextDev::Models::WebWebScrapeMdResponse, options: options diff --git a/rbi/context_dev/models/web_screenshot_params.rbi b/rbi/context_dev/models/web_screenshot_params.rbi index f2f38690..5effb615 100644 --- a/rbi/context_dev/models/web_screenshot_params.rbi +++ b/rbi/context_dev/models/web_screenshot_params.rbi @@ -69,23 +69,6 @@ module ContextDev sig { params(page: ContextDev::WebScreenshotParams::Page::OrSymbol).void } attr_writer :page - # Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - # faster capture with basic quality. If 'quality', optimizes for higher quality - # with longer wait times. Defaults to 'quality' if not provided. - sig do - returns( - T.nilable(ContextDev::WebScreenshotParams::Prioritize::OrSymbol) - ) - end - attr_reader :prioritize - - sig do - params( - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol - ).void - end - attr_writer :prioritize - # 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). @@ -104,6 +87,15 @@ module ContextDev end attr_writer :viewport + # Optional browser wait time in milliseconds after initial page load before taking + # the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + # omitted. + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + sig do params( direct_url: String, @@ -112,9 +104,9 @@ module ContextDev ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -141,16 +133,16 @@ module ContextDev # provided, screenshots the main domain landing page. Only applicable when using # 'domain', not 'directUrl'. page: nil, - # Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - # faster capture with basic quality. If 'quality', optimizes for higher quality - # with longer wait times. Defaults to 'quality' if not provided. - prioritize: nil, # 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). timeout_ms: nil, # Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. viewport: nil, + # Optional browser wait time in milliseconds after initial page load before taking + # the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + # omitted. + wait_for_ms: nil, request_options: {} ) end @@ -164,9 +156,9 @@ module ContextDev ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } ) @@ -245,38 +237,6 @@ module ContextDev end end - # Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - # faster capture with basic quality. If 'quality', optimizes for higher quality - # with longer wait times. Defaults to 'quality' if not provided. - module Prioritize - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ContextDev::WebScreenshotParams::Prioritize) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SPEED = - T.let( - :speed, - ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol - ) - QUALITY = - T.let( - :quality, - ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ContextDev::WebScreenshotParams::Prioritize::TaggedSymbol] - ) - end - def self.values - end - end - class Viewport < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/context_dev/models/web_web_crawl_md_params.rbi b/rbi/context_dev/models/web_web_crawl_md_params.rbi index 75bb922f..41d2b33e 100644 --- a/rbi/context_dev/models/web_web_crawl_md_params.rbi +++ b/rbi/context_dev/models/web_web_crawl_md_params.rbi @@ -109,6 +109,14 @@ module ContextDev sig { params(use_main_content_only: T::Boolean).void } attr_writer :use_main_content_only + # Optional browser wait time in milliseconds after initial page load for each + # crawled page. Min: 0. Max: 30000 (30 seconds). + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + sig do params( url: String, @@ -124,6 +132,7 @@ module ContextDev timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -164,6 +173,9 @@ module ContextDev # Extract only the main content, stripping headers, footers, sidebars, and # navigation use_main_content_only: nil, + # Optional browser wait time in milliseconds after initial page load for each + # crawled page. Min: 0. Max: 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end @@ -184,6 +196,7 @@ module ContextDev timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index e09e2d55..9eb380ff 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -52,6 +52,14 @@ module ContextDev sig { params(timeout_ms: Integer).void } attr_writer :timeout_ms + # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + # 30000 (30 seconds). + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + sig do params( url: String, @@ -59,6 +67,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: T::Boolean, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -79,6 +88,9 @@ module ContextDev # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). timeout_ms: nil, + # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + # 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end @@ -91,6 +103,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: T::Boolean, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/models/web_web_scrape_images_params.rbi b/rbi/context_dev/models/web_web_scrape_images_params.rbi index 0ff00e44..a5be0b21 100644 --- a/rbi/context_dev/models/web_web_scrape_images_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_images_params.rbi @@ -49,12 +49,21 @@ module ContextDev sig { params(timeout_ms: Integer).void } attr_writer :timeout_ms + # Optional browser wait time in milliseconds after initial page load before + # collecting images. Min: 0. Max: 30000 (30 seconds). + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + sig do params( url: String, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, max_age_ms: Integer, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -71,6 +80,9 @@ module ContextDev # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). timeout_ms: nil, + # Optional browser wait time in milliseconds after initial page load before + # collecting images. Min: 0. Max: 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end @@ -82,6 +94,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, max_age_ms: Integer, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index 1510807c..fb6b362a 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -79,6 +79,14 @@ module ContextDev sig { params(use_main_content_only: T::Boolean).void } attr_writer :use_main_content_only + # Optional browser wait time in milliseconds after initial page load before + # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + sig { returns(T.nilable(Integer)) } + attr_reader :wait_for_ms + + sig { params(wait_for_ms: Integer).void } + attr_writer :wait_for_ms + sig do params( url: String, @@ -90,6 +98,7 @@ module ContextDev shorten_base64_images: T::Boolean, timeout_ms: Integer, use_main_content_only: T::Boolean, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -120,6 +129,9 @@ module ContextDev # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation use_main_content_only: nil, + # Optional browser wait time in milliseconds after initial page load before + # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end @@ -136,6 +148,7 @@ module ContextDev shorten_base64_images: T::Boolean, timeout_ms: Integer, use_main_content_only: T::Boolean, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } ) diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index df082354..24d629a7 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -67,9 +67,9 @@ module ContextDev ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, - prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol, timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebScreenshotResponse) end @@ -96,16 +96,16 @@ module ContextDev # provided, screenshots the main domain landing page. Only applicable when using # 'domain', not 'directUrl'. page: nil, - # Optional parameter to prioritize screenshot capture. If 'speed', optimizes for - # faster capture with basic quality. If 'quality', optimizes for higher quality - # with longer wait times. Defaults to 'quality' if not provided. - prioritize: nil, # 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). timeout_ms: nil, # Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. viewport: nil, + # Optional browser wait time in milliseconds after initial page load before taking + # the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when + # omitted. + wait_for_ms: nil, request_options: {} ) end @@ -127,6 +127,7 @@ module ContextDev timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebCrawlMdResponse) end @@ -167,6 +168,9 @@ module ContextDev # Extract only the main content, stripping headers, footers, sidebars, and # navigation use_main_content_only: nil, + # Optional browser wait time in milliseconds after initial page load for each + # crawled page. Min: 0. Max: 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end @@ -179,6 +183,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: T::Boolean, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeHTMLResponse) end @@ -199,6 +204,9 @@ module ContextDev # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). timeout_ms: nil, + # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + # 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end @@ -213,6 +221,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, max_age_ms: Integer, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeImagesResponse) end @@ -229,6 +238,9 @@ module ContextDev # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). timeout_ms: nil, + # Optional browser wait time in milliseconds after initial page load before + # collecting images. Min: 0. Max: 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end @@ -245,6 +257,7 @@ module ContextDev shorten_base64_images: T::Boolean, timeout_ms: Integer, use_main_content_only: T::Boolean, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeMdResponse) end @@ -275,6 +288,9 @@ module ContextDev # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation use_main_content_only: nil, + # Optional browser wait time in milliseconds after initial page load before + # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). + wait_for_ms: nil, request_options: {} ) end diff --git a/sig/context_dev/models/web_screenshot_params.rbs b/sig/context_dev/models/web_screenshot_params.rbs index a5b26837..19856fee 100644 --- a/sig/context_dev/models/web_screenshot_params.rbs +++ b/sig/context_dev/models/web_screenshot_params.rbs @@ -7,9 +7,9 @@ module ContextDev full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, max_age_ms: Integer, page: ContextDev::Models::WebScreenshotParams::page, - prioritize: ContextDev::Models::WebScreenshotParams::prioritize, timeout_ms: Integer, - viewport: ContextDev::WebScreenshotParams::Viewport + viewport: ContextDev::WebScreenshotParams::Viewport, + wait_for_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -41,12 +41,6 @@ module ContextDev ContextDev::Models::WebScreenshotParams::page ) -> ContextDev::Models::WebScreenshotParams::page - attr_reader prioritize: ContextDev::Models::WebScreenshotParams::prioritize? - - def prioritize=: ( - ContextDev::Models::WebScreenshotParams::prioritize - ) -> ContextDev::Models::WebScreenshotParams::prioritize - attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -57,15 +51,19 @@ module ContextDev ContextDev::WebScreenshotParams::Viewport ) -> ContextDev::WebScreenshotParams::Viewport + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + def initialize: ( ?direct_url: String, ?domain: String, ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, ?max_age_ms: Integer, ?page: ContextDev::Models::WebScreenshotParams::page, - ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -75,9 +73,9 @@ module ContextDev full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, max_age_ms: Integer, page: ContextDev::Models::WebScreenshotParams::page, - prioritize: ContextDev::Models::WebScreenshotParams::prioritize, timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } @@ -117,17 +115,6 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::page] end - type prioritize = :speed | :quality - - module Prioritize - extend ContextDev::Internal::Type::Enum - - SPEED: :speed - QUALITY: :quality - - def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::prioritize] - end - type viewport = { height: Integer, width: Integer } class Viewport < ContextDev::Internal::Type::BaseModel diff --git a/sig/context_dev/models/web_web_crawl_md_params.rbs b/sig/context_dev/models/web_web_crawl_md_params.rbs index 3235043d..baaaaa10 100644 --- a/sig/context_dev/models/web_web_crawl_md_params.rbs +++ b/sig/context_dev/models/web_web_crawl_md_params.rbs @@ -14,7 +14,8 @@ module ContextDev :shorten_base64_images => bool, timeout_ms: Integer, url_regex: String, - use_main_content_only: bool + use_main_content_only: bool, + wait_for_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -72,6 +73,10 @@ module ContextDev def use_main_content_only=: (bool) -> bool + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + def initialize: ( url: String, ?follow_subdomains: bool, @@ -86,6 +91,7 @@ module ContextDev ?timeout_ms: Integer, ?url_regex: String, ?use_main_content_only: bool, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -103,6 +109,7 @@ module ContextDev timeout_ms: Integer, url_regex: String, use_main_content_only: bool, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } end diff --git a/sig/context_dev/models/web_web_scrape_html_params.rbs b/sig/context_dev/models/web_web_scrape_html_params.rbs index 34e594d7..f9c4a03d 100644 --- a/sig/context_dev/models/web_web_scrape_html_params.rbs +++ b/sig/context_dev/models/web_web_scrape_html_params.rbs @@ -6,7 +6,8 @@ module ContextDev include_frames: bool, max_age_ms: Integer, parse_pdf: bool, - timeout_ms: Integer + timeout_ms: Integer, + wait_for_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -32,12 +33,17 @@ module ContextDev def timeout_ms=: (Integer) -> Integer + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + def initialize: ( url: String, ?include_frames: bool, ?max_age_ms: Integer, ?parse_pdf: bool, ?timeout_ms: Integer, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -47,6 +53,7 @@ module ContextDev max_age_ms: Integer, parse_pdf: bool, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } end diff --git a/sig/context_dev/models/web_web_scrape_images_params.rbs b/sig/context_dev/models/web_web_scrape_images_params.rbs index e1f4434b..acecf286 100644 --- a/sig/context_dev/models/web_web_scrape_images_params.rbs +++ b/sig/context_dev/models/web_web_scrape_images_params.rbs @@ -5,7 +5,8 @@ module ContextDev url: String, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, max_age_ms: Integer, - timeout_ms: Integer + timeout_ms: Integer, + wait_for_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -29,11 +30,16 @@ module ContextDev def timeout_ms=: (Integer) -> Integer + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + def initialize: ( url: String, ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, ?max_age_ms: Integer, ?timeout_ms: Integer, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -42,6 +48,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, max_age_ms: Integer, timeout_ms: Integer, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index 0bf89526..9cca6f53 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -10,7 +10,8 @@ module ContextDev parse_pdf: bool, :shorten_base64_images => bool, timeout_ms: Integer, - use_main_content_only: bool + use_main_content_only: bool, + wait_for_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -52,6 +53,10 @@ module ContextDev def use_main_content_only=: (bool) -> bool + attr_reader wait_for_ms: Integer? + + def wait_for_ms=: (Integer) -> Integer + def initialize: ( url: String, ?include_frames: bool, @@ -62,6 +67,7 @@ module ContextDev ?shorten_base64_images: bool, ?timeout_ms: Integer, ?use_main_content_only: bool, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -75,6 +81,7 @@ module ContextDev :shorten_base64_images => bool, timeout_ms: Integer, use_main_content_only: bool, + wait_for_ms: Integer, request_options: ContextDev::RequestOptions } end diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 057f66e6..9c2579c3 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -21,9 +21,9 @@ module ContextDev ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, ?max_age_ms: Integer, ?page: ContextDev::Models::WebScreenshotParams::page, - ?prioritize: ContextDev::Models::WebScreenshotParams::prioritize, ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebScreenshotResponse @@ -41,6 +41,7 @@ module ContextDev ?timeout_ms: Integer, ?url_regex: String, ?use_main_content_only: bool, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebCrawlMdResponse @@ -50,6 +51,7 @@ module ContextDev ?max_age_ms: Integer, ?parse_pdf: bool, ?timeout_ms: Integer, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeHTMLResponse @@ -58,6 +60,7 @@ module ContextDev ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, ?max_age_ms: Integer, ?timeout_ms: Integer, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeImagesResponse @@ -71,6 +74,7 @@ module ContextDev ?shorten_base64_images: bool, ?timeout_ms: Integer, ?use_main_content_only: bool, + ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeMdResponse From 895c14dd027bbcdab6d237d987519ab596f2a111 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 May 2026 01:35:31 +0000 Subject: [PATCH 3/3] release: 1.17.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/context_dev/version.rb | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bc845f32..6a197bef 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.16.0" + ".": "1.17.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f2ccbe..c66d4af6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.17.0 (2026-05-09) + +Full Changelog: [v1.16.0...v1.17.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.16.0...v1.17.0) + +### Features + +* **api:** api update ([ae638b0](https://github.com/context-dot-dev/context-ruby-sdk/commit/ae638b04d0e08bf93e2cdd1211236d841d5313b1)) +* **api:** api update ([8376344](https://github.com/context-dot-dev/context-ruby-sdk/commit/8376344a7a72a7ff01906bc3d6a5913a4de60bcb)) + ## 1.16.0 (2026-05-07) Full Changelog: [v1.15.0...v1.16.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.15.0...v1.16.0) diff --git a/Gemfile.lock b/Gemfile.lock index 8a267339..0ed99eac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (1.16.0) + context.dev (1.17.0) cgi connection_pool diff --git a/README.md b/README.md index 41bd0a02..c4242d0e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "context.dev", "~> 1.16.0" +gem "context.dev", "~> 1.17.0" ``` diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index dd992a65..a28a32bb 100644 --- a/lib/context_dev/version.rb +++ b/lib/context_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ContextDev - VERSION = "1.16.0" + VERSION = "1.17.0" end