Class: ContextDev::Models::WebWebScrapeMdParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- ContextDev::Models::WebWebScrapeMdParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/context_dev/models/web_web_scrape_md_params.rb,
sig/context_dev/models/web_web_scrape_md_params.rbs
Overview
Defined Under Namespace
Modules: Action, Country, IncludeFrames, IncludeImages, IncludeLinks, SettleAnimations, ShortenBase64Images, UseMainContentOnly, Zdr Classes: Pdf
Constant Summary
Constants included from Internal::Type::RequestParameters
Internal::Type::RequestParameters::ContextDev
Instance Attribute Summary collapse
-
#actions ⇒ Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform>?
Optional browser actions executed in array order after the page loads and before content is captured.
-
#country ⇒ Symbol, ...
Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev residential proxy exit location.
-
#exclude_selectors ⇒ Array<String>?
CSS selectors to remove before conversion to Markdown.
-
#headers ⇒ Hash{Symbol=>String}?
Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers=value.
-
#include_frames ⇒ Boolean, ...
When true, the contents of iframes are rendered to Markdown.
-
#include_images ⇒ Boolean, ...
Include image references in Markdown output.
-
#include_links ⇒ Boolean, ...
Preserve hyperlinks in 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.
-
#pdf ⇒ ContextDev::Models::WebWebScrapeMdParams::Pdf?
PDF parsing controls.
-
#settle_animations ⇒ Boolean, ...
When true, waits briefly for CSS and transition animations to settle before converting to Markdown.
-
#shorten_base64_images ⇒ Boolean, ...
Shorten base64-encoded image data in the Markdown output.
-
#tags ⇒ Array<String>?
Optional comma-separated caller-defined tags for tracking this request.
-
#timeout_ms ⇒ Integer?
Optional timeout in milliseconds for the request.
-
#url ⇒ String
Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol).
-
#use_main_content_only ⇒ Boolean, ...
Extract only the main content of the page, excluding headers, footers, sidebars, and navigation.
-
#wait_for_ms ⇒ Integer?
Optional browser wait time in milliseconds after initial page load before converting the page to Markdown.
-
#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
- .values ⇒ Array<Symbol>
- .variants ⇒ Array(ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform)
Instance Method Summary collapse
-
#initialize(action:, do_: :perform) ⇒ Object
constructor
Resolve and perform one natural-language browser action.
- #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(action:, do_: :perform) ⇒ Object
Resolve and perform one natural-language browser action.
|
|
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 145
|
Instance Attribute Details
#actions ⇒ Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform>?
Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.
23 24 25 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 23 optional :actions, -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeMdParams::Action] }, nil?: true |
#country ⇒ Symbol, ...
Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev residential proxy exit location. Must be one of Context.dev's supported countries. When provided, Context.dev fetches the target page from that country.
33 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 33 optional :country, enum: -> { ContextDev::WebWebScrapeMdParams::Country } |
#exclude_selectors ⇒ Array<String>?
CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
41 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 41 optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true |
#headers ⇒ Hash{Symbol=>String}?
Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers=value. When provided, caching is bypassed: the result is neither read from nor written to cache.
49 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 49 optional :headers, ContextDev::Internal::Type::HashOf[String] |
#include_frames ⇒ Boolean, ...
When true, the contents of iframes are rendered to Markdown.
55 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 55 optional :include_frames, union: -> { ContextDev::WebWebScrapeMdParams::IncludeFrames } |
#include_images ⇒ Boolean, ...
Include image references in Markdown output
61 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 61 optional :include_images, union: -> { ContextDev::WebWebScrapeMdParams::IncludeImages } |
#include_links ⇒ Boolean, ...
Preserve hyperlinks in Markdown output
67 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 67 optional :include_links, union: -> { ContextDev::WebWebScrapeMdParams::IncludeLinks } |
#include_selectors ⇒ Array<String>?
CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before conversion to Markdown. When omitted, the entire document is kept. Examples: "article.main", "#content", "[role=main]".
75 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 75 optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true |
#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.
83 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 83 optional :max_age_ms, Integer, nil?: true |
#pdf ⇒ ContextDev::Models::WebWebScrapeMdParams::Pdf?
PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.
90 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 90 optional :pdf, -> { ContextDev::WebWebScrapeMdParams::Pdf } |
#settle_animations ⇒ Boolean, ...
When true, waits briefly for CSS and transition animations to settle before converting to Markdown. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.
98 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 98 optional :settle_animations, union: -> { ContextDev::WebWebScrapeMdParams::SettleAnimations } |
#shorten_base64_images ⇒ Boolean, ...
Shorten base64-encoded image data in the Markdown output
104 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 104 optional :shorten_base64_images, union: -> { ContextDev::WebWebScrapeMdParams::ShortenBase64Images } |
#tags ⇒ Array<String>?
Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.
112 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 112 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).
120 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 120 optional :timeout_ms, Integer |
#url ⇒ String
Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol)
15 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 15 required :url, String |
#use_main_content_only ⇒ Boolean, ...
Extract only the main content of the page, excluding headers, footers, sidebars, and navigation
127 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 127 optional :use_main_content_only, union: -> { ContextDev::WebWebScrapeMdParams::UseMainContentOnly } |
#wait_for_ms ⇒ Integer?
Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
134 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 134 optional :wait_for_ms, Integer, nil?: true |
#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.
143 |
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 143 optional :zdr, enum: -> { ContextDev::WebWebScrapeMdParams::Zdr } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 451
|
.variants ⇒ Array(ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform)
|
|
# File 'lib/context_dev/models/web_web_scrape_md_params.rb', line 236
|
Instance Method Details
#to_hash ⇒ {
130 |
# File 'sig/context_dev/models/web_web_scrape_md_params.rbs', line 130
def to_hash: -> {
|