Class: ContextDev::Models::WebExtractParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/context_dev/models/web_extract_params.rb,
sig/context_dev/models/web_extract_params.rbs

Overview

See Also:

  • ContextDev::Resources::Web#extract

Defined Under Namespace

Classes: Pdf

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::ContextDev

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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

#initializeObject



85
# File 'sig/context_dev/models/web_extract_params.rbs', line 85

def initialize: (

Instance Attribute Details

#fact_checkBoolean?

When true, every returned value must be grounded in facts stated on the page; fields that cannot be supported by the page are returned as null/empty. When false (default), the model may make reasonable inferences and derivations from the page content (e.g. ideal customer, competitor analysis, recommendations) while keeping verifiable specifics (names, quotes, URLs, dates, metrics) faithful to the source.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


34
# File 'lib/context_dev/models/web_extract_params.rb', line 34

optional :fact_check, ContextDev::Internal::Type::Boolean, api_name: :factCheck

#follow_subdomainsBoolean?

When true, follow links on subdomains of the starting URL's domain.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


40
# File 'lib/context_dev/models/web_extract_params.rb', line 40

optional :follow_subdomains, ContextDev::Internal::Type::Boolean, api_name: :followSubdomains

#include_framesBoolean?

When true, iframe contents are included in Markdown before extraction.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


46
# File 'lib/context_dev/models/web_extract_params.rb', line 46

optional :include_frames, ContextDev::Internal::Type::Boolean, api_name: :includeFrames

#instructionsString?

Optional extraction guidance, such as which facts to prioritize or how to interpret fields in the schema.

Parameters:

  • (String)

Returns:

  • (String, nil)


53
# File 'lib/context_dev/models/web_extract_params.rb', line 53

optional :instructions, String

#max_age_msInteger?

Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms).

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


60
# File 'lib/context_dev/models/web_extract_params.rb', line 60

optional :max_age_ms, Integer, api_name: :maxAgeMs

#max_depthInteger?

Optional maximum link depth from the starting URL (0 = only the starting page). If omitted, there is no crawl depth limit.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


67
# File 'lib/context_dev/models/web_extract_params.rb', line 67

optional :max_depth, Integer, api_name: :maxDepth

#max_pagesInteger?

Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


73
# File 'lib/context_dev/models/web_extract_params.rb', line 73

optional :max_pages, Integer, api_name: :maxPages

#pdfContextDev::Models::WebExtractParams::Pdf?



78
# File 'lib/context_dev/models/web_extract_params.rb', line 78

optional :pdf, -> { ContextDev::WebExtractParams::Pdf }

#schemaHash{Symbol=>Object}

JSON Schema for the returned data object. TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python users can pass the equivalent JSON Schema object.

Parameters:

  • value (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object})


16
# File 'lib/context_dev/models/web_extract_params.rb', line 16

required :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]

#settle_animationsBoolean?

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.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


86
# File 'lib/context_dev/models/web_extract_params.rb', line 86

optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations

#stop_after_msInteger?

Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


93
# File 'lib/context_dev/models/web_extract_params.rb', line 93

optional :stop_after_ms, Integer, api_name: :stopAfterMs

#tagsArray<String>?

Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


99
# File 'lib/context_dev/models/web_extract_params.rb', line 99

optional :tags, ContextDev::Internal::Type::ArrayOf[String]

#timeout_msInteger?

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).

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


107
# File 'lib/context_dev/models/web_extract_params.rb', line 107

optional :timeout_ms, Integer, api_name: :timeoutMS

#urlString

The starting website URL to crawl and extract from. Must include http:// or https://.

Parameters:

  • value (String)

Returns:

  • (String)


23
# File 'lib/context_dev/models/web_extract_params.rb', line 23

required :url, String

#wait_for_msInteger?

Optional browser wait time in milliseconds after initial page load for each crawled page.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


114
# File 'lib/context_dev/models/web_extract_params.rb', line 114

optional :wait_for_ms, Integer, api_name: :waitForMs

Instance Method Details

#to_hash{

Returns:

  • ({)


104
# File 'sig/context_dev/models/web_extract_params.rbs', line 104

def to_hash: -> {