Class: ContextDev::Models::WebWebCrawlMdParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- ContextDev::Models::WebWebCrawlMdParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/context_dev/models/web_web_crawl_md_params.rb,
sig/context_dev/models/web_web_crawl_md_params.rbs
Overview
Defined Under Namespace
Modules: Country, Zdr Classes: Pdf
Constant Summary
Constants included from Internal::Type::RequestParameters
Internal::Type::RequestParameters::ContextDev
Instance Attribute Summary collapse
-
#country ⇒ Symbol, ...
Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).
-
#exclude_selectors ⇒ Array<String>?
CSS selectors to remove before each crawled page is converted to Markdown.
-
#follow_subdomains ⇒ Boolean?
When true, follow links on subdomains of the starting URL's domain (e.g. docs.example.com when starting from example.com).
-
#include_frames ⇒ Boolean?
When true, the contents of iframes are rendered to Markdown for each crawled page.
-
#include_images ⇒ Boolean?
Include image references in the Markdown output.
-
#include_links ⇒ Boolean?
Preserve hyperlinks in the Markdown output.
-
#include_selectors ⇒ Array<String>?
CSS selectors.
-
#max_age_ms ⇒ Integer?
Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds.
-
#max_depth ⇒ Integer?
Maximum link depth from the starting URL (0 = only the starting page).
-
#max_pages ⇒ Integer?
Maximum number of pages to crawl.
-
#pdf ⇒ ContextDev::Models::WebWebCrawlMdParams::Pdf?
PDF parsing controls.
-
#settle_animations ⇒ Boolean?
When true, waits briefly for CSS and transition animations to settle before extracting each crawled page.
-
#shorten_base64_images ⇒ Boolean?
Truncate base64-encoded image data in the Markdown output.
-
#stop_after_ms ⇒ Integer?
Soft time budget for the crawl in milliseconds.
-
#tags ⇒ Array<String>?
Optional tags for tracking usage.
-
#timeout_ms ⇒ Integer?
Optional timeout in milliseconds for the request.
-
#url ⇒ String
The starting URL for the crawl (must include http:// or https:// protocol).
-
#url_regex ⇒ String?
Regex pattern.
-
#use_main_content_only ⇒ Boolean?
Extract only the main content, stripping headers, footers, sidebars, and navigation.
-
#wait_for_ms ⇒ Integer?
Optional browser wait time in milliseconds after initial page load for each crawled page.
-
#zdr ⇒ Symbol, ...
Set to enabled to bypass shared caches and omit request and response content from retained usage logs.
Attributes included from Internal::Type::RequestParameters
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(end_: nil, ocr: nil, should_parse: nil, start: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see Pdf for more details.
- #to_hash ⇒ {
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(end_: nil, ocr: nil, should_parse: nil, start: nil) ⇒ Object
Some parameter documentations has been truncated, see Pdf for more details.
PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.
|
|
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 160
|
Instance Attribute Details
#country ⇒ Symbol, ...
Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).
21 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 21 optional :country, enum: -> { ContextDev::WebWebCrawlMdParams::Country } |
#exclude_selectors ⇒ Array<String>?
CSS selectors to remove before each crawled page is converted to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
29 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 29 optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], api_name: :excludeSelectors |
#follow_subdomains ⇒ Boolean?
When true, follow links on subdomains of the starting URL's domain (e.g. docs.example.com when starting from example.com). www and apex are always treated as equivalent.
37 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 37 optional :follow_subdomains, ContextDev::Internal::Type::Boolean, api_name: :followSubdomains |
#include_frames ⇒ Boolean?
When true, the contents of iframes are rendered to Markdown for each crawled page.
44 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 44 optional :include_frames, ContextDev::Internal::Type::Boolean, api_name: :includeFrames |
#include_images ⇒ Boolean?
Include image references in the Markdown output
50 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 50 optional :include_images, ContextDev::Internal::Type::Boolean, api_name: :includeImages |
#include_links ⇒ Boolean?
Preserve hyperlinks in the Markdown output
56 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 56 optional :include_links, ContextDev::Internal::Type::Boolean, api_name: :includeLinks |
#include_selectors ⇒ Array<String>?
CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before each crawled page is converted to Markdown. When omitted, the entire document is kept. Examples: "article.main", "#content", "[role=main]".
65 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 65 optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], api_name: :includeSelectors |
#max_age_ms ⇒ Integer?
Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
73 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 73 optional :max_age_ms, Integer, api_name: :maxAgeMs |
#max_depth ⇒ Integer?
Maximum link depth from the starting URL (0 = only the starting page)
79 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 79 optional :max_depth, Integer, api_name: :maxDepth |
#max_pages ⇒ Integer?
Maximum number of pages to crawl. Hard cap: 500.
85 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 85 optional :max_pages, Integer, api_name: :maxPages |
#pdf ⇒ ContextDev::Models::WebWebCrawlMdParams::Pdf?
PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.
92 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 92 optional :pdf, -> { ContextDev::WebWebCrawlMdParams::Pdf } |
#settle_animations ⇒ Boolean?
When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.
100 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 100 optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations |
#shorten_base64_images ⇒ Boolean?
Truncate base64-encoded image data in the Markdown output
106 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 106 optional :shorten_base64_images, ContextDev::Internal::Type::Boolean, api_name: :shortenBase64Images |
#stop_after_ms ⇒ Integer?
Soft time budget for the crawl in milliseconds. After each scrape, the crawler checks the elapsed time and, if exceeded, returns the pages collected so far instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).
115 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 115 optional :stop_after_ms, Integer, api_name: :stopAfterMs |
#tags ⇒ Array<String>?
Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
121 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 121 optional :tags, ContextDev::Internal::Type::ArrayOf[String] |
#timeout_ms ⇒ Integer?
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).
129 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 129 optional :timeout_ms, Integer, api_name: :timeoutMS |
#url ⇒ String
The starting URL for the crawl (must include http:// or https:// protocol)
14 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 14 required :url, String |
#url_regex ⇒ String?
Regex pattern. Only URLs matching this pattern will be followed and scraped.
135 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 135 optional :url_regex, String, api_name: :urlRegex |
#use_main_content_only ⇒ Boolean?
Extract only the main content, stripping headers, footers, sidebars, and navigation
142 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 142 optional :use_main_content_only, ContextDev::Internal::Type::Boolean, api_name: :useMainContentOnly |
#wait_for_ms ⇒ Integer?
Optional browser wait time in milliseconds after initial page load for each crawled page. Min: 0. Max: 30000 (30 seconds).
149 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 149 optional :wait_for_ms, Integer, api_name: :waitForMs |
#zdr ⇒ Symbol, ...
Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
158 |
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 158 optional :zdr, enum: -> { ContextDev::WebWebCrawlMdParams::Zdr } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/context_dev/models/web_web_crawl_md_params.rb', line 418
|
Instance Method Details
#to_hash ⇒ {
146 |
# File 'sig/context_dev/models/web_web_crawl_md_params.rbs', line 146
def to_hash: -> {
|