context.dev 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +2 -2
- data/lib/context_dev/client.rb +6 -0
- data/lib/context_dev/internal/type/base_model.rb +2 -2
- data/lib/context_dev/models/ai_extract_product_params.rb +53 -8
- data/lib/context_dev/models/ai_extract_product_response.rb +19 -1
- data/lib/context_dev/models/ai_extract_products_params.rb +116 -16
- data/lib/context_dev/models/ai_extract_products_response.rb +20 -1
- data/lib/context_dev/models/batch_cancel_response.rb +10 -1
- data/lib/context_dev/models/batch_delete_response.rb +13 -1
- data/lib/context_dev/models/batch_get_results_response.rb +13 -1
- data/lib/context_dev/models/batch_list_response.rb +13 -1
- data/lib/context_dev/models/batch_retrieve_response.rb +10 -1
- data/lib/context_dev/models/batch_submit_response.rb +10 -1
- data/lib/context_dev/models/brand_retrieve_params.rb +355 -60
- data/lib/context_dev/models/brand_retrieve_response.rb +19 -1
- data/lib/context_dev/models/brand_retrieve_simplified_params.rb +57 -11
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +19 -1
- data/lib/context_dev/models/brand_search_response.rb +10 -1
- data/lib/context_dev/models/industry_retrieve_naics_params.rb +53 -8
- data/lib/context_dev/models/industry_retrieve_naics_response.rb +22 -1
- data/lib/context_dev/models/industry_retrieve_sic_params.rb +53 -8
- data/lib/context_dev/models/industry_retrieve_sic_response.rb +19 -1
- data/lib/context_dev/models/log_list_params.rb +108 -0
- data/lib/context_dev/models/log_list_response.rb +174 -0
- data/lib/context_dev/models/log_retrieve_params.rb +22 -0
- data/lib/context_dev/models/log_retrieve_response.rb +226 -0
- data/lib/context_dev/models/monitor_create_params.rb +27 -3
- data/lib/context_dev/models/monitor_create_response.rb +30 -5
- data/lib/context_dev/models/monitor_list_response.rb +30 -5
- data/lib/context_dev/models/monitor_retrieve_response.rb +30 -5
- data/lib/context_dev/models/monitor_update_params.rb +27 -3
- data/lib/context_dev/models/monitor_update_response.rb +30 -5
- data/lib/context_dev/models/news_search_response.rb +10 -1
- data/lib/context_dev/models/parse_handle_response.rb +13 -1
- data/lib/context_dev/models/person_enrich_params.rb +53 -8
- data/lib/context_dev/models/person_enrich_response.rb +22 -1
- data/lib/context_dev/models/utility_prefetch_params.rb +48 -8
- data/lib/context_dev/models/utility_prefetch_response.rb +13 -1
- data/lib/context_dev/models/web_answers_params.rb +124 -0
- data/lib/context_dev/models/web_answers_response.rb +68 -0
- data/lib/context_dev/models/web_extract_competitors_params.rb +53 -8
- data/lib/context_dev/models/web_extract_competitors_response.rb +22 -1
- data/lib/context_dev/models/web_extract_fonts_params.rb +58 -11
- data/lib/context_dev/models/web_extract_fonts_response.rb +41 -1
- data/lib/context_dev/models/web_extract_params.rb +53 -8
- data/lib/context_dev/models/web_extract_response.rb +19 -1
- data/lib/context_dev/models/web_extract_styleguide_params.rb +58 -11
- data/lib/context_dev/models/web_extract_styleguide_response.rb +41 -1
- data/lib/context_dev/models/web_screenshot_params.rb +58 -9
- data/lib/context_dev/models/web_screenshot_response.rb +41 -1
- data/lib/context_dev/models/web_search_params.rb +112 -16
- data/lib/context_dev/models/web_search_response.rb +52 -2
- data/lib/context_dev/models/web_web_crawl_md_params.rb +53 -8
- data/lib/context_dev/models/web_web_crawl_md_response.rb +20 -1
- data/lib/context_dev/models/web_web_scrape_bytes_params.rb +344 -0
- data/lib/context_dev/models/web_web_scrape_bytes_response.rb +135 -0
- data/lib/context_dev/models/web_web_scrape_html_params.rb +58 -9
- data/lib/context_dev/models/web_web_scrape_html_response.rb +41 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +58 -9
- data/lib/context_dev/models/web_web_scrape_images_response.rb +51 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +58 -9
- data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -1
- data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +53 -8
- data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +20 -1
- data/lib/context_dev/models/webhooks/delivery_list_attempts_response.rb +13 -1
- data/lib/context_dev/models/webhooks/delivery_list_response.rb +13 -1
- data/lib/context_dev/models/webhooks/delivery_retrieve_response.rb +13 -1
- data/lib/context_dev/models/webhooks/delivery_retry_response.rb +13 -1
- data/lib/context_dev/models.rb +8 -0
- data/lib/context_dev/resources/ai.rb +2 -2
- data/lib/context_dev/resources/brand.rb +3 -3
- data/lib/context_dev/resources/industry.rb +6 -6
- data/lib/context_dev/resources/logs.rb +83 -0
- data/lib/context_dev/resources/people.rb +2 -2
- data/lib/context_dev/resources/utility.rb +2 -2
- data/lib/context_dev/resources/web.rb +119 -33
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +9 -0
- data/rbi/context_dev/client.rbi +5 -0
- data/rbi/context_dev/models/ai_extract_product_params.rbi +125 -13
- data/rbi/context_dev/models/ai_extract_product_response.rbi +23 -0
- data/rbi/context_dev/models/ai_extract_products_params.rbi +264 -26
- data/rbi/context_dev/models/ai_extract_products_response.rbi +25 -0
- data/rbi/context_dev/models/batch_cancel_response.rbi +10 -0
- data/rbi/context_dev/models/batch_delete_response.rbi +10 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +10 -0
- data/rbi/context_dev/models/batch_list_response.rbi +10 -0
- data/rbi/context_dev/models/batch_retrieve_response.rbi +10 -0
- data/rbi/context_dev/models/batch_submit_response.rbi +10 -0
- data/rbi/context_dev/models/brand_retrieve_params.rbi +816 -102
- data/rbi/context_dev/models/brand_retrieve_response.rbi +23 -0
- data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +136 -19
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +23 -0
- data/rbi/context_dev/models/brand_search_response.rbi +10 -0
- data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +127 -13
- data/rbi/context_dev/models/industry_retrieve_naics_response.rbi +23 -0
- data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +127 -13
- data/rbi/context_dev/models/industry_retrieve_sic_response.rbi +23 -0
- data/rbi/context_dev/models/log_list_params.rbi +162 -0
- data/rbi/context_dev/models/log_list_response.rbi +246 -0
- data/rbi/context_dev/models/log_retrieve_params.rbi +40 -0
- data/rbi/context_dev/models/log_retrieve_response.rbi +370 -0
- data/rbi/context_dev/models/monitor_create_params.rbi +40 -2
- data/rbi/context_dev/models/monitor_create_response.rbi +44 -4
- data/rbi/context_dev/models/monitor_list_response.rbi +44 -4
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +44 -4
- data/rbi/context_dev/models/monitor_update_params.rbi +40 -2
- data/rbi/context_dev/models/monitor_update_response.rbi +44 -4
- data/rbi/context_dev/models/news_search_response.rbi +10 -0
- data/rbi/context_dev/models/parse_handle_response.rbi +10 -0
- data/rbi/context_dev/models/person_enrich_params.rbi +123 -13
- data/rbi/context_dev/models/person_enrich_response.rbi +26 -3
- data/rbi/context_dev/models/utility_prefetch_params.rbi +112 -13
- data/rbi/context_dev/models/utility_prefetch_response.rbi +10 -0
- data/rbi/context_dev/models/web_answers_params.rbi +234 -0
- data/rbi/context_dev/models/web_answers_response.rbi +122 -0
- data/rbi/context_dev/models/web_extract_competitors_params.rbi +127 -13
- data/rbi/context_dev/models/web_extract_competitors_response.rbi +26 -3
- data/rbi/context_dev/models/web_extract_fonts_params.rbi +132 -19
- data/rbi/context_dev/models/web_extract_fonts_response.rbi +81 -0
- data/rbi/context_dev/models/web_extract_params.rbi +120 -13
- data/rbi/context_dev/models/web_extract_response.rbi +26 -3
- data/rbi/context_dev/models/web_extract_styleguide_params.rbi +136 -19
- data/rbi/context_dev/models/web_extract_styleguide_response.rbi +81 -0
- data/rbi/context_dev/models/web_screenshot_params.rbi +132 -15
- data/rbi/context_dev/models/web_screenshot_response.rbi +81 -0
- data/rbi/context_dev/models/web_search_params.rbi +253 -26
- data/rbi/context_dev/models/web_search_response.rbi +102 -6
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +123 -13
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +29 -3
- data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +699 -0
- data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +238 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +134 -15
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +71 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +136 -15
- data/rbi/context_dev/models/web_web_scrape_images_response.rbi +99 -3
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +132 -15
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +71 -0
- data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +127 -13
- data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +28 -3
- data/rbi/context_dev/models/webhooks/delivery_list_attempts_response.rbi +10 -0
- data/rbi/context_dev/models/webhooks/delivery_list_response.rbi +10 -0
- data/rbi/context_dev/models/webhooks/delivery_retrieve_response.rbi +10 -0
- data/rbi/context_dev/models/webhooks/delivery_retry_response.rbi +10 -0
- data/rbi/context_dev/models.rbi +8 -0
- data/rbi/context_dev/resources/ai.rbi +5 -5
- data/rbi/context_dev/resources/brand.rbi +9 -8
- data/rbi/context_dev/resources/industry.rbi +12 -10
- data/rbi/context_dev/resources/logs.rbi +76 -0
- data/rbi/context_dev/resources/people.rbi +5 -5
- data/rbi/context_dev/resources/utility.rbi +5 -5
- data/rbi/context_dev/resources/web.rbi +173 -68
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/ai_extract_product_params.rbs +44 -5
- data/sig/context_dev/models/ai_extract_product_response.rbs +12 -0
- data/sig/context_dev/models/ai_extract_products_params.rbs +88 -10
- data/sig/context_dev/models/ai_extract_products_response.rbs +12 -0
- data/sig/context_dev/models/batch_cancel_response.rbs +5 -0
- data/sig/context_dev/models/batch_delete_response.rbs +5 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +5 -0
- data/sig/context_dev/models/batch_list_response.rbs +5 -0
- data/sig/context_dev/models/batch_retrieve_response.rbs +5 -0
- data/sig/context_dev/models/batch_submit_response.rbs +5 -0
- data/sig/context_dev/models/brand_retrieve_params.rbs +264 -30
- data/sig/context_dev/models/brand_retrieve_response.rbs +12 -0
- data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +44 -5
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +12 -0
- data/sig/context_dev/models/brand_search_response.rbs +5 -0
- data/sig/context_dev/models/industry_retrieve_naics_params.rbs +44 -5
- data/sig/context_dev/models/industry_retrieve_naics_response.rbs +12 -0
- data/sig/context_dev/models/industry_retrieve_sic_params.rbs +44 -5
- data/sig/context_dev/models/industry_retrieve_sic_response.rbs +12 -0
- data/sig/context_dev/models/log_list_params.rbs +98 -0
- data/sig/context_dev/models/log_list_response.rbs +135 -0
- data/sig/context_dev/models/log_retrieve_params.rbs +23 -0
- data/sig/context_dev/models/log_retrieve_response.rbs +179 -0
- data/sig/context_dev/models/monitor_create_params.rbs +14 -0
- data/sig/context_dev/models/monitor_create_response.rbs +14 -0
- data/sig/context_dev/models/monitor_list_response.rbs +14 -0
- data/sig/context_dev/models/monitor_retrieve_response.rbs +14 -0
- data/sig/context_dev/models/monitor_update_params.rbs +14 -0
- data/sig/context_dev/models/monitor_update_response.rbs +14 -0
- data/sig/context_dev/models/news_search_response.rbs +5 -0
- data/sig/context_dev/models/parse_handle_response.rbs +5 -0
- data/sig/context_dev/models/person_enrich_params.rbs +44 -5
- data/sig/context_dev/models/person_enrich_response.rbs +15 -3
- data/sig/context_dev/models/utility_prefetch_params.rbs +43 -5
- data/sig/context_dev/models/utility_prefetch_response.rbs +5 -0
- data/sig/context_dev/models/web_answers_params.rbs +106 -0
- data/sig/context_dev/models/web_answers_response.rbs +60 -0
- data/sig/context_dev/models/web_extract_competitors_params.rbs +44 -5
- data/sig/context_dev/models/web_extract_competitors_response.rbs +15 -3
- data/sig/context_dev/models/web_extract_fonts_params.rbs +44 -5
- data/sig/context_dev/models/web_extract_fonts_response.rbs +25 -0
- data/sig/context_dev/models/web_extract_params.rbs +44 -5
- data/sig/context_dev/models/web_extract_response.rbs +15 -3
- data/sig/context_dev/models/web_extract_styleguide_params.rbs +44 -5
- data/sig/context_dev/models/web_extract_styleguide_response.rbs +25 -0
- data/sig/context_dev/models/web_screenshot_params.rbs +44 -5
- data/sig/context_dev/models/web_screenshot_response.rbs +25 -0
- data/sig/context_dev/models/web_search_params.rbs +88 -10
- data/sig/context_dev/models/web_search_response.rbs +38 -6
- data/sig/context_dev/models/web_web_crawl_md_params.rbs +44 -5
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +15 -3
- data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +531 -0
- data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +108 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +44 -5
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +44 -5
- data/sig/context_dev/models/web_web_scrape_images_response.rbs +35 -3
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +44 -5
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +44 -5
- data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +15 -3
- data/sig/context_dev/models/webhooks/delivery_list_attempts_response.rbs +5 -0
- data/sig/context_dev/models/webhooks/delivery_list_response.rbs +5 -0
- data/sig/context_dev/models/webhooks/delivery_retrieve_response.rbs +7 -0
- data/sig/context_dev/models/webhooks/delivery_retry_response.rbs +5 -0
- data/sig/context_dev/models.rbs +8 -0
- data/sig/context_dev/resources/ai.rbs +1 -1
- data/sig/context_dev/resources/brand.rbs +1 -1
- data/sig/context_dev/resources/industry.rbs +2 -2
- data/sig/context_dev/resources/logs.rbs +27 -0
- data/sig/context_dev/resources/people.rbs +1 -1
- data/sig/context_dev/resources/utility.rbs +1 -1
- data/sig/context_dev/resources/web.rbs +30 -11
- metadata +29 -2
|
@@ -3,13 +3,50 @@
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
5
|
class Web
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {ContextDev::Models::WebAnswersParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Researches the live web and returns a sourced answer in your requested JSON
|
|
10
|
+
# shape. Select fast for a smaller research budget at 10 credits or ultra for
|
|
11
|
+
# deeper reasoning at 100 credits. Defaults to ultra. Fast research is limited to
|
|
12
|
+
# 30 seconds and ultra to 50 seconds; timeoutOpts.milliseconds can shorten either
|
|
13
|
+
# deadline.
|
|
14
|
+
#
|
|
15
|
+
# @overload answers(task:, json_format: nil, mode: nil, tags: nil, timeout_opts: nil, request_options: {})
|
|
16
|
+
#
|
|
17
|
+
# @param task [String] What to research and answer, in plain language. Naming a domain in the task (for
|
|
18
|
+
#
|
|
19
|
+
# @param json_format [Hash{Symbol=>Object}] An example object with placeholder values (for example {"pricing_page_url": "",
|
|
20
|
+
#
|
|
21
|
+
# @param mode [Symbol, ContextDev::Models::WebAnswersParams::Mode] Research level: fast uses a smaller model and research budget for 10 credits; ul
|
|
22
|
+
#
|
|
23
|
+
# @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
24
|
+
#
|
|
25
|
+
# @param timeout_opts [ContextDev::Models::WebAnswersParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
26
|
+
#
|
|
27
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
28
|
+
#
|
|
29
|
+
# @return [ContextDev::Models::WebAnswersResponse]
|
|
30
|
+
#
|
|
31
|
+
# @see ContextDev::Models::WebAnswersParams
|
|
32
|
+
def answers(params)
|
|
33
|
+
parsed, options = ContextDev::WebAnswersParams.dump_request(params)
|
|
34
|
+
@client.request(
|
|
35
|
+
method: :post,
|
|
36
|
+
path: "web/answers",
|
|
37
|
+
body: parsed,
|
|
38
|
+
model: ContextDev::Models::WebAnswersResponse,
|
|
39
|
+
options: options
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
6
43
|
# Some parameter documentations has been truncated, see
|
|
7
44
|
# {ContextDev::Models::WebExtractParams} for more details.
|
|
8
45
|
#
|
|
9
46
|
# Crawl a website, use the provided JSON Schema and instructions to prioritize
|
|
10
47
|
# relevant internal links, and extract structured data from the selected pages.
|
|
11
48
|
#
|
|
12
|
-
# @overload extract(schema:, url:, actions: nil, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil,
|
|
49
|
+
# @overload extract(schema:, url:, actions: nil, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, request_options: {})
|
|
13
50
|
#
|
|
14
51
|
# @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. Image fields such as `image_urls` or `
|
|
15
52
|
#
|
|
@@ -39,7 +76,7 @@ module ContextDev
|
|
|
39
76
|
#
|
|
40
77
|
# @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
41
78
|
#
|
|
42
|
-
# @param
|
|
79
|
+
# @param timeout_opts [ContextDev::Models::WebExtractParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
43
80
|
#
|
|
44
81
|
# @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw
|
|
45
82
|
#
|
|
@@ -65,7 +102,7 @@ module ContextDev
|
|
|
65
102
|
# Analyze a company's landing page and web search evidence to return direct
|
|
66
103
|
# competitors for the same product or market.
|
|
67
104
|
#
|
|
68
|
-
# @overload extract_competitors(domain:, num_competitors: nil, tags: nil,
|
|
105
|
+
# @overload extract_competitors(domain:, num_competitors: nil, tags: nil, timeout_opts: nil, request_options: {})
|
|
69
106
|
#
|
|
70
107
|
# @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
|
|
71
108
|
#
|
|
@@ -73,7 +110,7 @@ module ContextDev
|
|
|
73
110
|
#
|
|
74
111
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
75
112
|
#
|
|
76
|
-
# @param
|
|
113
|
+
# @param timeout_opts [ContextDev::Models::WebExtractCompetitorsParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
77
114
|
#
|
|
78
115
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
79
116
|
#
|
|
@@ -86,7 +123,7 @@ module ContextDev
|
|
|
86
123
|
@client.request(
|
|
87
124
|
method: :get,
|
|
88
125
|
path: "web/competitors",
|
|
89
|
-
query: query.transform_keys(num_competitors: "numCompetitors",
|
|
126
|
+
query: query.transform_keys(num_competitors: "numCompetitors", timeout_opts: "timeoutOpts"),
|
|
90
127
|
model: ContextDev::Models::WebExtractCompetitorsResponse,
|
|
91
128
|
options: options
|
|
92
129
|
)
|
|
@@ -98,7 +135,7 @@ module ContextDev
|
|
|
98
135
|
# Scrape font information from a website including font families, usage
|
|
99
136
|
# statistics, fallbacks, and element/word counts.
|
|
100
137
|
#
|
|
101
|
-
# @overload extract_fonts(direct_url: nil, domain: nil, max_age_ms: nil, tags: nil,
|
|
138
|
+
# @overload extract_fonts(direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, request_options: {})
|
|
102
139
|
#
|
|
103
140
|
# @param direct_url [String] A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
|
|
104
141
|
#
|
|
@@ -108,7 +145,7 @@ module ContextDev
|
|
|
108
145
|
#
|
|
109
146
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
110
147
|
#
|
|
111
|
-
# @param
|
|
148
|
+
# @param timeout_opts [ContextDev::Models::WebExtractFontsParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
112
149
|
#
|
|
113
150
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
114
151
|
#
|
|
@@ -124,7 +161,7 @@ module ContextDev
|
|
|
124
161
|
query: query.transform_keys(
|
|
125
162
|
direct_url: "directUrl",
|
|
126
163
|
max_age_ms: "maxAgeMs",
|
|
127
|
-
|
|
164
|
+
timeout_opts: "timeoutOpts"
|
|
128
165
|
),
|
|
129
166
|
model: ContextDev::Models::WebExtractFontsResponse,
|
|
130
167
|
options: options
|
|
@@ -137,7 +174,7 @@ module ContextDev
|
|
|
137
174
|
# Extract a comprehensive design system from a website including colors,
|
|
138
175
|
# typography, spacing, shadows, and UI components.
|
|
139
176
|
#
|
|
140
|
-
# @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, tags: nil,
|
|
177
|
+
# @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, request_options: {})
|
|
141
178
|
#
|
|
142
179
|
# @param color_scheme [Symbol, ContextDev::Models::WebExtractStyleguideParams::ColorScheme] Optional browser color scheme to emulate for websites that respond to prefers-co
|
|
143
180
|
#
|
|
@@ -149,7 +186,7 @@ module ContextDev
|
|
|
149
186
|
#
|
|
150
187
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
151
188
|
#
|
|
152
|
-
# @param
|
|
189
|
+
# @param timeout_opts [ContextDev::Models::WebExtractStyleguideParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
153
190
|
#
|
|
154
191
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
155
192
|
#
|
|
@@ -166,7 +203,7 @@ module ContextDev
|
|
|
166
203
|
color_scheme: "colorScheme",
|
|
167
204
|
direct_url: "directUrl",
|
|
168
205
|
max_age_ms: "maxAgeMs",
|
|
169
|
-
|
|
206
|
+
timeout_opts: "timeoutOpts"
|
|
170
207
|
),
|
|
171
208
|
model: ContextDev::Models::WebExtractStyleguideResponse,
|
|
172
209
|
options: options
|
|
@@ -178,7 +215,7 @@ module ContextDev
|
|
|
178
215
|
#
|
|
179
216
|
# Capture a screenshot of a website.
|
|
180
217
|
#
|
|
181
|
-
# @overload screenshot(clear_popups: nil, color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil,
|
|
218
|
+
# @overload screenshot(clear_popups: nil, color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_opts: nil, viewport: nil, wait_for_ms: nil, zdr: nil, request_options: {})
|
|
182
219
|
#
|
|
183
220
|
# @param clear_popups [Boolean] Optional parameter for comprehensive popup cleanup. If 'true', the browser dismi
|
|
184
221
|
#
|
|
@@ -202,7 +239,7 @@ module ContextDev
|
|
|
202
239
|
#
|
|
203
240
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
204
241
|
#
|
|
205
|
-
# @param
|
|
242
|
+
# @param timeout_opts [ContextDev::Models::WebScreenshotParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
206
243
|
#
|
|
207
244
|
# @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
208
245
|
#
|
|
@@ -229,7 +266,7 @@ module ContextDev
|
|
|
229
266
|
handle_cookie_popup: "handleCookiePopup",
|
|
230
267
|
max_age_ms: "maxAgeMs",
|
|
231
268
|
scroll_offset: "scrollOffset",
|
|
232
|
-
|
|
269
|
+
timeout_opts: "timeoutOpts",
|
|
233
270
|
wait_for_ms: "waitForMs"
|
|
234
271
|
),
|
|
235
272
|
model: ContextDev::Models::WebScreenshotResponse,
|
|
@@ -242,7 +279,7 @@ module ContextDev
|
|
|
242
279
|
#
|
|
243
280
|
# Search the web and optionally scrape each result to Markdown in one round-trip.
|
|
244
281
|
#
|
|
245
|
-
# @overload search(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, tags: nil,
|
|
282
|
+
# @overload search(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, tags: nil, timeout_opts: nil, request_options: {})
|
|
246
283
|
#
|
|
247
284
|
# @param query [String] Search query. Accepts natural language as well as Google-style search operators
|
|
248
285
|
#
|
|
@@ -262,7 +299,7 @@ module ContextDev
|
|
|
262
299
|
#
|
|
263
300
|
# @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
264
301
|
#
|
|
265
|
-
# @param
|
|
302
|
+
# @param timeout_opts [ContextDev::Models::WebSearchParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
266
303
|
#
|
|
267
304
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
268
305
|
#
|
|
@@ -286,7 +323,7 @@ module ContextDev
|
|
|
286
323
|
# Performs a crawl starting from a given URL, extracts page content as Markdown,
|
|
287
324
|
# and returns results for all crawled pages.
|
|
288
325
|
#
|
|
289
|
-
# @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil,
|
|
326
|
+
# @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil, timeout_opts: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
|
|
290
327
|
#
|
|
291
328
|
# @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
|
|
292
329
|
#
|
|
@@ -320,7 +357,7 @@ module ContextDev
|
|
|
320
357
|
#
|
|
321
358
|
# @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
322
359
|
#
|
|
323
|
-
# @param
|
|
360
|
+
# @param timeout_opts [ContextDev::Models::WebWebCrawlMdParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
324
361
|
#
|
|
325
362
|
# @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. An
|
|
326
363
|
#
|
|
@@ -346,13 +383,62 @@ module ContextDev
|
|
|
346
383
|
)
|
|
347
384
|
end
|
|
348
385
|
|
|
386
|
+
# Some parameter documentations has been truncated, see
|
|
387
|
+
# {ContextDev::Models::WebWebScrapeBytesParams} for more details.
|
|
388
|
+
#
|
|
389
|
+
# Downloads a resource and returns its bytes as base64. Supports images, PDFs,
|
|
390
|
+
# HTML pages, and any other content type without image conversion, text
|
|
391
|
+
# extraction, or character-encoding changes. HTTP compression is decoded before
|
|
392
|
+
# base64 encoding. HTML is the original HTTP response; JavaScript is not rendered.
|
|
393
|
+
# Follows public redirects and retries failed downloads through ISP and
|
|
394
|
+
# residential proxies, with a direct fallback. When country is specified, only a
|
|
395
|
+
# residential proxy in that country is used. Supply headers such as Referer for
|
|
396
|
+
# images that require a referring page. Downloads are not cached. Maximum decoded
|
|
397
|
+
# resource size: 20 MiB (20971520 bytes), before base64 encoding. Successful
|
|
398
|
+
# requests cost 1 credit; errors are not billed.
|
|
399
|
+
#
|
|
400
|
+
# @overload web_scrape_bytes(url:, country: nil, headers: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
|
|
401
|
+
#
|
|
402
|
+
# @param url [String] Full HTTP(S) URL of the resource to download, such as an image, PDF, or page.
|
|
403
|
+
#
|
|
404
|
+
# @param country [Symbol, ContextDev::Models::WebWebScrapeBytesParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
|
|
405
|
+
#
|
|
406
|
+
# @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers, such as Referer, Cookie, or Authorization. Send
|
|
407
|
+
#
|
|
408
|
+
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
409
|
+
#
|
|
410
|
+
# @param timeout_opts [ContextDev::Models::WebWebScrapeBytesParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
411
|
+
#
|
|
412
|
+
# @param zdr [Symbol, ContextDev::Models::WebWebScrapeBytesParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
|
|
413
|
+
#
|
|
414
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
415
|
+
#
|
|
416
|
+
# @return [ContextDev::Models::WebWebScrapeBytesResponse]
|
|
417
|
+
#
|
|
418
|
+
# @see ContextDev::Models::WebWebScrapeBytesParams
|
|
419
|
+
def web_scrape_bytes(params)
|
|
420
|
+
parsed, options = ContextDev::WebWebScrapeBytesParams.dump_request(params)
|
|
421
|
+
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
422
|
+
@client.request(
|
|
423
|
+
method: :get,
|
|
424
|
+
path: "web/scrape/bytes",
|
|
425
|
+
query: query.transform_keys(timeout_opts: "timeoutOpts"),
|
|
426
|
+
model: ContextDev::Models::WebWebScrapeBytesResponse,
|
|
427
|
+
options: options
|
|
428
|
+
)
|
|
429
|
+
end
|
|
430
|
+
|
|
349
431
|
# Some parameter documentations has been truncated, see
|
|
350
432
|
# {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
|
|
351
433
|
#
|
|
352
434
|
# Scrapes the given URL and returns the raw HTML content of the page. The base
|
|
353
|
-
# request costs 1 credit; requests with browser actions cost 2 credits.
|
|
435
|
+
# request costs 1 credit; requests with browser actions cost 2 credits. A request
|
|
436
|
+
# that hits its timeoutOpts.milliseconds deadline fails with 408 and is not
|
|
437
|
+
# billed, unless timeoutOpts.behavior=return-partial is set — then the page as
|
|
438
|
+
# rendered so far is returned with `finalDOMState: "still-loading"` and billed at
|
|
439
|
+
# the base cost of 1 credit.
|
|
354
440
|
#
|
|
355
|
-
# @overload web_scrape_html(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, tags: nil,
|
|
441
|
+
# @overload web_scrape_html(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, tags: nil, timeout_opts: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
|
|
356
442
|
#
|
|
357
443
|
# @param url [String] Full URL to scrape (must include http:// or https:// protocol)
|
|
358
444
|
#
|
|
@@ -376,7 +462,7 @@ module ContextDev
|
|
|
376
462
|
#
|
|
377
463
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
378
464
|
#
|
|
379
|
-
# @param
|
|
465
|
+
# @param timeout_opts [ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
380
466
|
#
|
|
381
467
|
# @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h
|
|
382
468
|
#
|
|
@@ -401,7 +487,7 @@ module ContextDev
|
|
|
401
487
|
include_selectors: "includeSelectors",
|
|
402
488
|
max_age_ms: "maxAgeMs",
|
|
403
489
|
settle_animations: "settleAnimations",
|
|
404
|
-
|
|
490
|
+
timeout_opts: "timeoutOpts",
|
|
405
491
|
use_main_content_only: "useMainContentOnly",
|
|
406
492
|
wait_for_ms: "waitForMs"
|
|
407
493
|
),
|
|
@@ -419,7 +505,7 @@ module ContextDev
|
|
|
419
505
|
# enrichment is enabled, the entire call costs 5 credits, including requests that
|
|
420
506
|
# also use actions.
|
|
421
507
|
#
|
|
422
|
-
# @overload web_scrape_images(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil,
|
|
508
|
+
# @overload web_scrape_images(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, request_options: {})
|
|
423
509
|
#
|
|
424
510
|
# @param url [String] Page URL to inspect. Must include http:// or https://.
|
|
425
511
|
#
|
|
@@ -435,7 +521,7 @@ module ContextDev
|
|
|
435
521
|
#
|
|
436
522
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
437
523
|
#
|
|
438
|
-
# @param
|
|
524
|
+
# @param timeout_opts [ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
439
525
|
#
|
|
440
526
|
# @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before collec
|
|
441
527
|
#
|
|
@@ -452,7 +538,7 @@ module ContextDev
|
|
|
452
538
|
path: "web/scrape/images",
|
|
453
539
|
query: query.transform_keys(
|
|
454
540
|
max_age_ms: "maxAgeMs",
|
|
455
|
-
|
|
541
|
+
timeout_opts: "timeoutOpts",
|
|
456
542
|
wait_for_ms: "waitForMs"
|
|
457
543
|
),
|
|
458
544
|
model: ContextDev::Models::WebWebScrapeImagesResponse,
|
|
@@ -483,17 +569,17 @@ module ContextDev
|
|
|
483
569
|
#
|
|
484
570
|
# | HTTP status | Billed? | Meaning |
|
|
485
571
|
# | ----------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
486
|
-
# | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing
|
|
572
|
+
# | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing. A partial result (`finalDOMState: "still-loading"`, only with timeoutOpts.behavior=return-partial) is billed at the base 1 credit with no OCR or actions surcharge |
|
|
487
573
|
# | 400 | No | Invalid input, skipped PDF, or the page could not be scraped. error_code WEBSITE_BLOCKED specifically means the site answered with an anti-bot challenge, CAPTCHA wall, or login shell instead of the page (even when the site returned HTTP 200) — retrying later or from another country sometimes succeeds |
|
|
488
574
|
# | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
|
|
489
575
|
# | 404 | No | Target page returned or fingerprinted as not found |
|
|
490
|
-
# | 408 | No | Request timed out
|
|
576
|
+
# | 408 | No | Request timed out. With timeoutOpts.behavior=return-partial this only happens when nothing usable had rendered by the deadline |
|
|
491
577
|
# | 413 | No | Target content exceeds the maximum supported size (20 MB) |
|
|
492
578
|
# | 415 | No | Unsupported content type |
|
|
493
579
|
# | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
|
|
494
580
|
# | 500 | No | Internal error |
|
|
495
581
|
#
|
|
496
|
-
# @overload web_scrape_md(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_html: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil,
|
|
582
|
+
# @overload web_scrape_md(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_html: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_opts: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
|
|
497
583
|
#
|
|
498
584
|
# @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
|
|
499
585
|
#
|
|
@@ -525,7 +611,7 @@ module ContextDev
|
|
|
525
611
|
#
|
|
526
612
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
527
613
|
#
|
|
528
|
-
# @param
|
|
614
|
+
# @param timeout_opts [ContextDev::Models::WebWebScrapeMdParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
529
615
|
#
|
|
530
616
|
# @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
531
617
|
#
|
|
@@ -554,7 +640,7 @@ module ContextDev
|
|
|
554
640
|
max_age_ms: "maxAgeMs",
|
|
555
641
|
settle_animations: "settleAnimations",
|
|
556
642
|
shorten_base64_images: "shortenBase64Images",
|
|
557
|
-
|
|
643
|
+
timeout_opts: "timeoutOpts",
|
|
558
644
|
use_main_content_only: "useMainContentOnly",
|
|
559
645
|
wait_for_ms: "waitForMs"
|
|
560
646
|
),
|
|
@@ -573,7 +659,7 @@ module ContextDev
|
|
|
573
659
|
# `pricing and plans` or `api authentication docs`), most relevant first — a
|
|
574
660
|
# searched crawl scans the whole sitemap and costs 2 credits instead of 1.
|
|
575
661
|
#
|
|
576
|
-
# @overload web_scrape_sitemap(domain:, headers: nil, include_subdomains: nil, max_links: nil, search: nil, sitemap_url: nil, tags: nil,
|
|
662
|
+
# @overload web_scrape_sitemap(domain:, headers: nil, include_subdomains: nil, max_links: nil, search: nil, sitemap_url: nil, tags: nil, timeout_opts: nil, url_regex: nil, zdr: nil, request_options: {})
|
|
577
663
|
#
|
|
578
664
|
# @param domain [String] Domain to build a sitemap for
|
|
579
665
|
#
|
|
@@ -589,7 +675,7 @@ module ContextDev
|
|
|
589
675
|
#
|
|
590
676
|
# @param tags [Array<String>] Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50 charac
|
|
591
677
|
#
|
|
592
|
-
# @param
|
|
678
|
+
# @param timeout_opts [ContextDev::Models::WebWebScrapeSitemapParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
|
|
593
679
|
#
|
|
594
680
|
# @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
|
|
595
681
|
#
|
|
@@ -610,7 +696,7 @@ module ContextDev
|
|
|
610
696
|
include_subdomains: "includeSubdomains",
|
|
611
697
|
max_links: "maxLinks",
|
|
612
698
|
sitemap_url: "sitemapUrl",
|
|
613
|
-
|
|
699
|
+
timeout_opts: "timeoutOpts",
|
|
614
700
|
url_regex: "urlRegex"
|
|
615
701
|
),
|
|
616
702
|
model: ContextDev::Models::WebWebScrapeSitemapResponse,
|
data/lib/context_dev/version.rb
CHANGED
data/lib/context_dev.rb
CHANGED
|
@@ -82,6 +82,10 @@ require_relative "context_dev/models/industry_retrieve_naics_response"
|
|
|
82
82
|
require_relative "context_dev/models/industry_retrieve_sic_params"
|
|
83
83
|
require_relative "context_dev/models/industry_retrieve_sic_response"
|
|
84
84
|
require_relative "context_dev/models/intake"
|
|
85
|
+
require_relative "context_dev/models/log_list_params"
|
|
86
|
+
require_relative "context_dev/models/log_list_response"
|
|
87
|
+
require_relative "context_dev/models/log_retrieve_params"
|
|
88
|
+
require_relative "context_dev/models/log_retrieve_response"
|
|
85
89
|
require_relative "context_dev/models/monitor_create_params"
|
|
86
90
|
require_relative "context_dev/models/monitor_create_response"
|
|
87
91
|
require_relative "context_dev/models/monitor_delete_params"
|
|
@@ -118,6 +122,8 @@ require_relative "context_dev/models/person_enrich_response"
|
|
|
118
122
|
require_relative "context_dev/models/retry_config"
|
|
119
123
|
require_relative "context_dev/models/utility_prefetch_params"
|
|
120
124
|
require_relative "context_dev/models/utility_prefetch_response"
|
|
125
|
+
require_relative "context_dev/models/web_answers_params"
|
|
126
|
+
require_relative "context_dev/models/web_answers_response"
|
|
121
127
|
require_relative "context_dev/models/web_extract_competitors_params"
|
|
122
128
|
require_relative "context_dev/models/web_extract_competitors_response"
|
|
123
129
|
require_relative "context_dev/models/web_extract_fonts_params"
|
|
@@ -143,6 +149,8 @@ require_relative "context_dev/models/web_search_params"
|
|
|
143
149
|
require_relative "context_dev/models/web_search_response"
|
|
144
150
|
require_relative "context_dev/models/web_web_crawl_md_params"
|
|
145
151
|
require_relative "context_dev/models/web_web_crawl_md_response"
|
|
152
|
+
require_relative "context_dev/models/web_web_scrape_bytes_params"
|
|
153
|
+
require_relative "context_dev/models/web_web_scrape_bytes_response"
|
|
146
154
|
require_relative "context_dev/models/web_web_scrape_html_params"
|
|
147
155
|
require_relative "context_dev/models/web_web_scrape_html_response"
|
|
148
156
|
require_relative "context_dev/models/web_web_scrape_images_params"
|
|
@@ -156,6 +164,7 @@ require_relative "context_dev/resources/ai"
|
|
|
156
164
|
require_relative "context_dev/resources/batch"
|
|
157
165
|
require_relative "context_dev/resources/brand"
|
|
158
166
|
require_relative "context_dev/resources/industry"
|
|
167
|
+
require_relative "context_dev/resources/logs"
|
|
159
168
|
require_relative "context_dev/resources/monitors"
|
|
160
169
|
require_relative "context_dev/resources/news"
|
|
161
170
|
require_relative "context_dev/resources/parse"
|
data/rbi/context_dev/client.rbi
CHANGED
|
@@ -52,6 +52,11 @@ module ContextDev
|
|
|
52
52
|
sig { returns(ContextDev::Resources::News) }
|
|
53
53
|
attr_reader :news
|
|
54
54
|
|
|
55
|
+
# Read your organization's API request logs to debug failed calls. These endpoints
|
|
56
|
+
# cost no credits and use a separate rate limit.
|
|
57
|
+
sig { returns(ContextDev::Resources::Logs) }
|
|
58
|
+
attr_reader :logs
|
|
59
|
+
|
|
55
60
|
# @api private
|
|
56
61
|
sig { override.returns(T::Hash[String, String]) }
|
|
57
62
|
private def auth_headers
|
|
@@ -34,21 +34,27 @@ module ContextDev
|
|
|
34
34
|
sig { params(tags: T::Array[String]).void }
|
|
35
35
|
attr_writer :tags
|
|
36
36
|
|
|
37
|
-
# Optional
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
sig
|
|
41
|
-
|
|
37
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
38
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
39
|
+
# timeoutOpts object.
|
|
40
|
+
sig do
|
|
41
|
+
returns(T.nilable(ContextDev::AIExtractProductParams::TimeoutOpts))
|
|
42
|
+
end
|
|
43
|
+
attr_reader :timeout_opts
|
|
42
44
|
|
|
43
|
-
sig
|
|
44
|
-
|
|
45
|
+
sig do
|
|
46
|
+
params(
|
|
47
|
+
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts::OrHash
|
|
48
|
+
).void
|
|
49
|
+
end
|
|
50
|
+
attr_writer :timeout_opts
|
|
45
51
|
|
|
46
52
|
sig do
|
|
47
53
|
params(
|
|
48
54
|
url: String,
|
|
49
55
|
max_age_ms: Integer,
|
|
50
56
|
tags: T::Array[String],
|
|
51
|
-
|
|
57
|
+
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts::OrHash,
|
|
52
58
|
request_options: ContextDev::RequestOptions::OrHash
|
|
53
59
|
).returns(T.attached_class)
|
|
54
60
|
end
|
|
@@ -61,10 +67,10 @@ module ContextDev
|
|
|
61
67
|
max_age_ms: nil,
|
|
62
68
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
63
69
|
tags: nil,
|
|
64
|
-
# Optional
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
|
|
70
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
71
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
72
|
+
# timeoutOpts object.
|
|
73
|
+
timeout_opts: nil,
|
|
68
74
|
request_options: {}
|
|
69
75
|
)
|
|
70
76
|
end
|
|
@@ -75,13 +81,119 @@ module ContextDev
|
|
|
75
81
|
url: String,
|
|
76
82
|
max_age_ms: Integer,
|
|
77
83
|
tags: T::Array[String],
|
|
78
|
-
|
|
84
|
+
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts,
|
|
79
85
|
request_options: ContextDev::RequestOptions
|
|
80
86
|
}
|
|
81
87
|
)
|
|
82
88
|
end
|
|
83
89
|
def to_hash
|
|
84
90
|
end
|
|
91
|
+
|
|
92
|
+
class TimeoutOpts < ContextDev::Internal::Type::BaseModel
|
|
93
|
+
OrHash =
|
|
94
|
+
T.type_alias do
|
|
95
|
+
T.any(
|
|
96
|
+
ContextDev::AIExtractProductParams::TimeoutOpts,
|
|
97
|
+
ContextDev::Internal::AnyHash
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Request deadline in milliseconds. Maximum: 300000 (5 minutes).
|
|
102
|
+
sig { returns(Integer) }
|
|
103
|
+
attr_accessor :milliseconds
|
|
104
|
+
|
|
105
|
+
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
106
|
+
# credits. "return-partial" returns usable results collected so far; if none are
|
|
107
|
+
# available, the request still fails without charging credits. Partial results are
|
|
108
|
+
# not cached as complete results.
|
|
109
|
+
sig do
|
|
110
|
+
returns(
|
|
111
|
+
T.nilable(
|
|
112
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior::OrSymbol
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
attr_reader :behavior
|
|
117
|
+
|
|
118
|
+
sig do
|
|
119
|
+
params(
|
|
120
|
+
behavior:
|
|
121
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior::OrSymbol
|
|
122
|
+
).void
|
|
123
|
+
end
|
|
124
|
+
attr_writer :behavior
|
|
125
|
+
|
|
126
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
127
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
128
|
+
# timeoutOpts object.
|
|
129
|
+
sig do
|
|
130
|
+
params(
|
|
131
|
+
milliseconds: Integer,
|
|
132
|
+
behavior:
|
|
133
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior::OrSymbol
|
|
134
|
+
).returns(T.attached_class)
|
|
135
|
+
end
|
|
136
|
+
def self.new(
|
|
137
|
+
# Request deadline in milliseconds. Maximum: 300000 (5 minutes).
|
|
138
|
+
milliseconds:,
|
|
139
|
+
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
140
|
+
# credits. "return-partial" returns usable results collected so far; if none are
|
|
141
|
+
# available, the request still fails without charging credits. Partial results are
|
|
142
|
+
# not cached as complete results.
|
|
143
|
+
behavior: nil
|
|
144
|
+
)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
sig do
|
|
148
|
+
override.returns(
|
|
149
|
+
{
|
|
150
|
+
milliseconds: Integer,
|
|
151
|
+
behavior:
|
|
152
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior::OrSymbol
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
def to_hash
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# What to do at the deadline. "fail" returns 408 REQUEST_TIMEOUT without charging
|
|
160
|
+
# credits. "return-partial" returns usable results collected so far; if none are
|
|
161
|
+
# available, the request still fails without charging credits. Partial results are
|
|
162
|
+
# not cached as complete results.
|
|
163
|
+
module Behavior
|
|
164
|
+
extend ContextDev::Internal::Type::Enum
|
|
165
|
+
|
|
166
|
+
TaggedSymbol =
|
|
167
|
+
T.type_alias do
|
|
168
|
+
T.all(
|
|
169
|
+
Symbol,
|
|
170
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior
|
|
171
|
+
)
|
|
172
|
+
end
|
|
173
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
174
|
+
|
|
175
|
+
FAIL =
|
|
176
|
+
T.let(
|
|
177
|
+
:fail,
|
|
178
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior::TaggedSymbol
|
|
179
|
+
)
|
|
180
|
+
RETURN_PARTIAL =
|
|
181
|
+
T.let(
|
|
182
|
+
:"return-partial",
|
|
183
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior::TaggedSymbol
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
sig do
|
|
187
|
+
override.returns(
|
|
188
|
+
T::Array[
|
|
189
|
+
ContextDev::AIExtractProductParams::TimeoutOpts::Behavior::TaggedSymbol
|
|
190
|
+
]
|
|
191
|
+
)
|
|
192
|
+
end
|
|
193
|
+
def self.values
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
85
197
|
end
|
|
86
198
|
end
|
|
87
199
|
end
|