Class: Telnyx::Resources::WebSearch
- Inherits:
-
Object
- Object
- Telnyx::Resources::WebSearch
- Defined in:
- lib/telnyx/resources/web_search.rb,
lib/telnyx/resources/web_search/research.rb,
sig/telnyx/resources/web_search.rbs,
sig/telnyx/resources/web_search/research.rbs
Defined Under Namespace
Classes: Research
Instance Attribute Summary collapse
-
#research ⇒ Telnyx::Resources::WebSearch::Research
readonly
Deep research with citations and async task polling.
Instance Method Summary collapse
-
#contents(urls:, crawl_timeout: nil, formats: nil, max_age: nil, request_options: {}) ⇒ Telnyx::Models::WebSearchContentsResponse
Some parameter documentations has been truncated, see Models::WebSearchContentsParams for more details.
-
#create(query:, count: nil, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, livecrawl: nil, safesearch: nil, request_options: {}) ⇒ Telnyx::Models::WebSearchCreateResponse
Some parameter documentations has been truncated, see Models::WebSearchCreateParams for more details.
-
#initialize(client:) ⇒ WebSearch
constructor
private
A new instance of WebSearch.
Constructor Details
#initialize(client:) ⇒ WebSearch
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of WebSearch.
90 91 92 93 |
# File 'lib/telnyx/resources/web_search.rb', line 90 def initialize(client:) @client = client @research = Telnyx::Resources::WebSearch::Research.new(client: client) end |
Instance Attribute Details
#research ⇒ Telnyx::Resources::WebSearch::Research (readonly)
Deep research with citations and async task polling.
8 9 10 |
# File 'lib/telnyx/resources/web_search.rb', line 8 def research @research end |
Instance Method Details
#contents(urls:, crawl_timeout: nil, formats: nil, max_age: nil, request_options: {}) ⇒ Telnyx::Models::WebSearchContentsResponse
Some parameter documentations has been truncated, see Models::WebSearchContentsParams for more details.
Retrieves clean HTML or Markdown content from a list of URLs. Supports up to 20
URLs per request (public API limit). Specify which formats to return: html,
markdown, metadata.
76 77 78 79 80 81 82 83 84 85 |
# File 'lib/telnyx/resources/web_search.rb', line 76 def contents(params) parsed, = Telnyx::WebSearchContentsParams.dump_request(params) @client.request( method: :post, path: "web_search/contents", body: parsed, model: Telnyx::Models::WebSearchContentsResponse, options: ) end |
#create(query:, count: nil, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, livecrawl: nil, safesearch: nil, request_options: {}) ⇒ Telnyx::Models::WebSearchCreateResponse
Some parameter documentations has been truncated, see Models::WebSearchCreateParams for more details.
Performs a real-time web search and returns structured, LLM-ready JSON results with titles, URLs, descriptions, and snippets. Supports filtering by domain, country, safe search, freshness, and live crawl.
Note: include_domains and exclude_domains cannot be used in the same
request. Use one or the other.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/telnyx/resources/web_search.rb', line 43 def create(params) parsed, = Telnyx::WebSearchCreateParams.dump_request(params) @client.request( method: :post, path: "web_search", body: parsed, model: Telnyx::Models::WebSearchCreateResponse, options: ) end |