Class: ContextDev::Models::WebSearchParams

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

Overview

Defined Under Namespace

Modules: Country, Freshness Classes: MarkdownOptions

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

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

#initialize(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, timeout_ms: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see ContextDev::Models::WebSearchParams for more details.

Parameters:

  • query (String)

    Search query. Accepts natural language as well as Google-style search operators

  • country (Symbol, ContextDev::Models::WebSearchParams::Country) (defaults to: nil)

    Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific cou

  • exclude_domains (Array<String>) (defaults to: nil)

    Blocklist — drop results from these domains. Example: [“pinterest.com”, “reddit.

  • freshness (Symbol, ContextDev::Models::WebSearchParams::Freshness) (defaults to: nil)

    Restrict results to content published within this window.

  • include_domains (Array<String>) (defaults to: nil)

    Allowlist — only return results from these domains. Example: [“arxiv.org”, “gith

  • markdown_options (ContextDev::Models::WebSearchParams::MarkdownOptions) (defaults to: nil)

    Inline Markdown scraping for each result. Set ‘enabled: true` to activate.

  • num_results (Integer) (defaults to: nil)

    Number of results to request and return (10–100). Defaults to 10.

  • query_fanout (Boolean) (defaults to: nil)

    Expand the query into multiple parallel variants for broader recall.

  • timeout_ms (Integer) (defaults to: nil)

    Optional timeout in milliseconds for the request. If the request takes longer th

  • request_options (ContextDev::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/context_dev/models/web_search_params.rb', line 72

Instance Attribute Details

#countrySymbol, ...

Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google’s ‘gl` parameter). Example: “us”, “gb”, “de”.



22
# File 'lib/context_dev/models/web_search_params.rb', line 22

optional :country, enum: -> { ContextDev::WebSearchParams::Country }

#exclude_domainsArray<String>?

Blocklist — drop results from these domains. Example: [“pinterest.com”, “reddit.com”].

Returns:

  • (Array<String>, nil)


29
# File 'lib/context_dev/models/web_search_params.rb', line 29

optional :exclude_domains, ContextDev::Internal::Type::ArrayOf[String], api_name: :excludeDomains

#freshnessSymbol, ...

Restrict results to content published within this window.



35
# File 'lib/context_dev/models/web_search_params.rb', line 35

optional :freshness, enum: -> { ContextDev::WebSearchParams::Freshness }

#include_domainsArray<String>?

Allowlist — only return results from these domains. Example: [“arxiv.org”, “github.com”].

Returns:

  • (Array<String>, nil)


42
# File 'lib/context_dev/models/web_search_params.rb', line 42

optional :include_domains, ContextDev::Internal::Type::ArrayOf[String], api_name: :includeDomains

#markdown_optionsContextDev::Models::WebSearchParams::MarkdownOptions?

Inline Markdown scraping for each result. Set ‘enabled: true` to activate.



48
49
50
# File 'lib/context_dev/models/web_search_params.rb', line 48

optional :markdown_options,
-> { ContextDev::WebSearchParams::MarkdownOptions },
api_name: :markdownOptions

#num_resultsInteger?

Number of results to request and return (10–100). Defaults to 10.

Returns:

  • (Integer, nil)


56
# File 'lib/context_dev/models/web_search_params.rb', line 56

optional :num_results, Integer, api_name: :numResults

#queryString

Search query. Accepts natural language as well as Google-style search operators such as ‘site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.

Returns:

  • (String)


15
# File 'lib/context_dev/models/web_search_params.rb', line 15

required :query, String

#query_fanoutBoolean?

Expand the query into multiple parallel variants for broader recall.

Returns:

  • (Boolean, nil)


62
# File 'lib/context_dev/models/web_search_params.rb', line 62

optional :query_fanout, ContextDev::Internal::Type::Boolean, api_name: :queryFanout

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

Returns:

  • (Integer, nil)


70
# File 'lib/context_dev/models/web_search_params.rb', line 70

optional :timeout_ms, Integer, api_name: :timeoutMS

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/web_search_params.rb', line 341