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,6 +3,45 @@
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
5
|
class Web
|
|
6
|
+
# Researches the live web and returns a sourced answer in your requested JSON
|
|
7
|
+
# shape. Select fast for a smaller research budget at 10 credits or ultra for
|
|
8
|
+
# deeper reasoning at 100 credits. Defaults to ultra. Fast research is limited to
|
|
9
|
+
# 30 seconds and ultra to 50 seconds; timeoutOpts.milliseconds can shorten either
|
|
10
|
+
# deadline.
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
task: String,
|
|
14
|
+
json_format: T::Hash[Symbol, T.anything],
|
|
15
|
+
mode: ContextDev::WebAnswersParams::Mode::OrSymbol,
|
|
16
|
+
tags: T::Array[String],
|
|
17
|
+
timeout_opts: ContextDev::WebAnswersParams::TimeoutOpts::OrHash,
|
|
18
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
19
|
+
).returns(ContextDev::Models::WebAnswersResponse)
|
|
20
|
+
end
|
|
21
|
+
def answers(
|
|
22
|
+
# What to research and answer, in plain language. Naming a domain in the task (for
|
|
23
|
+
# example "pricing on context.dev") makes the agent read that site before it
|
|
24
|
+
# searches.
|
|
25
|
+
task:,
|
|
26
|
+
# An example object with placeholder values (for example {"pricing_page_url": "",
|
|
27
|
+
# "plans": [{"name": "", "price": 0}]}). Object keys and value types are
|
|
28
|
+
# preserved; unknown values may be null. Empty arrays accept any JSON items.
|
|
29
|
+
# Defaults to {"result": ""}. Maximum 8 levels, 500 values, and 16000 characters.
|
|
30
|
+
json_format: nil,
|
|
31
|
+
# Research level: fast uses a smaller model and research budget for 10 credits;
|
|
32
|
+
# ultra uses deeper reasoning and research for 100 credits. Defaults to ultra.
|
|
33
|
+
# Only successful requests consume credits.
|
|
34
|
+
mode: nil,
|
|
35
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
36
|
+
tags: nil,
|
|
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
|
+
timeout_opts: nil,
|
|
41
|
+
request_options: {}
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
6
45
|
# Crawl a website, use the provided JSON Schema and instructions to prioritize
|
|
7
46
|
# relevant internal links, and extract structured data from the selected pages.
|
|
8
47
|
sig do
|
|
@@ -28,7 +67,7 @@ module ContextDev
|
|
|
28
67
|
settle_animations: T::Boolean,
|
|
29
68
|
stop_after_ms: Integer,
|
|
30
69
|
tags: T::Array[String],
|
|
31
|
-
|
|
70
|
+
timeout_opts: ContextDev::WebExtractParams::TimeoutOpts::OrHash,
|
|
32
71
|
wait_for_ms: Integer,
|
|
33
72
|
request_options: ContextDev::RequestOptions::OrHash
|
|
34
73
|
).returns(ContextDev::Models::WebExtractResponse)
|
|
@@ -81,10 +120,10 @@ module ContextDev
|
|
|
81
120
|
stop_after_ms: nil,
|
|
82
121
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
83
122
|
tags: nil,
|
|
84
|
-
# Optional
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
|
|
123
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
124
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
125
|
+
# timeoutOpts object.
|
|
126
|
+
timeout_opts: nil,
|
|
88
127
|
# Optional browser wait time in milliseconds after initial page load for each
|
|
89
128
|
# crawled page.
|
|
90
129
|
wait_for_ms: nil,
|
|
@@ -99,7 +138,8 @@ module ContextDev
|
|
|
99
138
|
domain: String,
|
|
100
139
|
num_competitors: Integer,
|
|
101
140
|
tags: T::Array[String],
|
|
102
|
-
|
|
141
|
+
timeout_opts:
|
|
142
|
+
ContextDev::WebExtractCompetitorsParams::TimeoutOpts::OrHash,
|
|
103
143
|
request_options: ContextDev::RequestOptions::OrHash
|
|
104
144
|
).returns(ContextDev::Models::WebExtractCompetitorsResponse)
|
|
105
145
|
end
|
|
@@ -112,10 +152,10 @@ module ContextDev
|
|
|
112
152
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
113
153
|
# characters.
|
|
114
154
|
tags: nil,
|
|
115
|
-
# Optional
|
|
116
|
-
#
|
|
117
|
-
#
|
|
118
|
-
|
|
155
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
156
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
157
|
+
# timeoutOpts object.
|
|
158
|
+
timeout_opts: nil,
|
|
119
159
|
request_options: {}
|
|
120
160
|
)
|
|
121
161
|
end
|
|
@@ -128,7 +168,7 @@ module ContextDev
|
|
|
128
168
|
domain: String,
|
|
129
169
|
max_age_ms: T.nilable(Integer),
|
|
130
170
|
tags: T::Array[String],
|
|
131
|
-
|
|
171
|
+
timeout_opts: ContextDev::WebExtractFontsParams::TimeoutOpts::OrHash,
|
|
132
172
|
request_options: ContextDev::RequestOptions::OrHash
|
|
133
173
|
).returns(ContextDev::Models::WebExtractFontsResponse)
|
|
134
174
|
end
|
|
@@ -142,17 +182,17 @@ module ContextDev
|
|
|
142
182
|
# 'domain' or 'directUrl', but not both.
|
|
143
183
|
domain: nil,
|
|
144
184
|
# Maximum age in milliseconds for cached brand data before the API performs a hard
|
|
145
|
-
# refresh. Defaults to 3 months (7776000000 ms).
|
|
146
|
-
# are clamped to
|
|
147
|
-
# year.
|
|
185
|
+
# refresh. Defaults to 3 months (7776000000 ms). Set to 0 to always perform a hard
|
|
186
|
+
# refresh. Negative values are clamped to 0; values above 1 year (31536000000 ms)
|
|
187
|
+
# are clamped to 1 year.
|
|
148
188
|
max_age_ms: nil,
|
|
149
189
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
150
190
|
# characters.
|
|
151
191
|
tags: nil,
|
|
152
|
-
# Optional
|
|
153
|
-
#
|
|
154
|
-
#
|
|
155
|
-
|
|
192
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
193
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
194
|
+
# timeoutOpts object.
|
|
195
|
+
timeout_opts: nil,
|
|
156
196
|
request_options: {}
|
|
157
197
|
)
|
|
158
198
|
end
|
|
@@ -167,7 +207,8 @@ module ContextDev
|
|
|
167
207
|
domain: String,
|
|
168
208
|
max_age_ms: T.nilable(Integer),
|
|
169
209
|
tags: T::Array[String],
|
|
170
|
-
|
|
210
|
+
timeout_opts:
|
|
211
|
+
ContextDev::WebExtractStyleguideParams::TimeoutOpts::OrHash,
|
|
171
212
|
request_options: ContextDev::RequestOptions::OrHash
|
|
172
213
|
).returns(ContextDev::Models::WebExtractStyleguideResponse)
|
|
173
214
|
end
|
|
@@ -185,17 +226,17 @@ module ContextDev
|
|
|
185
226
|
# 'domain' or 'directUrl', but not both.
|
|
186
227
|
domain: nil,
|
|
187
228
|
# Maximum age in milliseconds for cached brand data before the API performs a hard
|
|
188
|
-
# refresh. Defaults to 3 months (7776000000 ms).
|
|
189
|
-
# are clamped to
|
|
190
|
-
# year.
|
|
229
|
+
# refresh. Defaults to 3 months (7776000000 ms). Set to 0 to always perform a hard
|
|
230
|
+
# refresh. Negative values are clamped to 0; values above 1 year (31536000000 ms)
|
|
231
|
+
# are clamped to 1 year.
|
|
191
232
|
max_age_ms: nil,
|
|
192
233
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
193
234
|
# characters.
|
|
194
235
|
tags: nil,
|
|
195
|
-
# Optional
|
|
196
|
-
#
|
|
197
|
-
#
|
|
198
|
-
|
|
236
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
237
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
238
|
+
# timeoutOpts object.
|
|
239
|
+
timeout_opts: nil,
|
|
199
240
|
request_options: {}
|
|
200
241
|
)
|
|
201
242
|
end
|
|
@@ -215,7 +256,7 @@ module ContextDev
|
|
|
215
256
|
page: ContextDev::WebScreenshotParams::Page::OrSymbol,
|
|
216
257
|
scroll_offset: T.nilable(Integer),
|
|
217
258
|
tags: T::Array[String],
|
|
218
|
-
|
|
259
|
+
timeout_opts: ContextDev::WebScreenshotParams::TimeoutOpts::OrHash,
|
|
219
260
|
viewport: ContextDev::WebScreenshotParams::Viewport::OrHash,
|
|
220
261
|
wait_for_ms: T.nilable(Integer),
|
|
221
262
|
zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol,
|
|
@@ -271,15 +312,17 @@ module ContextDev
|
|
|
271
312
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
272
313
|
# characters.
|
|
273
314
|
tags: nil,
|
|
274
|
-
# Optional
|
|
275
|
-
#
|
|
276
|
-
#
|
|
277
|
-
|
|
315
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
316
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
317
|
+
# timeoutOpts object.
|
|
318
|
+
timeout_opts: nil,
|
|
278
319
|
# Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
279
320
|
viewport: nil,
|
|
280
321
|
# Optional browser wait time in milliseconds after initial page load before taking
|
|
281
322
|
# the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
|
|
282
|
-
# omitted.
|
|
323
|
+
# omitted. When combined with timeoutOpts, timeoutOpts.milliseconds must be at
|
|
324
|
+
# least waitForMs + 10000 ms; a shorter deadline is rejected with 400
|
|
325
|
+
# TIMEOUT_TOO_SHORT_FOR_WAIT.
|
|
283
326
|
wait_for_ms: nil,
|
|
284
327
|
# Set to enabled to bypass shared caches and omit request and response content
|
|
285
328
|
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
@@ -303,7 +346,7 @@ module ContextDev
|
|
|
303
346
|
num_results: Integer,
|
|
304
347
|
query_fanout: T::Boolean,
|
|
305
348
|
tags: T::Array[String],
|
|
306
|
-
|
|
349
|
+
timeout_opts: ContextDev::WebSearchParams::TimeoutOpts::OrHash,
|
|
307
350
|
request_options: ContextDev::RequestOptions::OrHash
|
|
308
351
|
).returns(ContextDev::Models::WebSearchResponse)
|
|
309
352
|
end
|
|
@@ -330,10 +373,10 @@ module ContextDev
|
|
|
330
373
|
query_fanout: nil,
|
|
331
374
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
332
375
|
tags: nil,
|
|
333
|
-
# Optional
|
|
334
|
-
#
|
|
335
|
-
#
|
|
336
|
-
|
|
376
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
377
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
378
|
+
# timeoutOpts object.
|
|
379
|
+
timeout_opts: nil,
|
|
337
380
|
request_options: {}
|
|
338
381
|
)
|
|
339
382
|
end
|
|
@@ -358,7 +401,7 @@ module ContextDev
|
|
|
358
401
|
shorten_base64_images: T::Boolean,
|
|
359
402
|
stop_after_ms: Integer,
|
|
360
403
|
tags: T::Array[String],
|
|
361
|
-
|
|
404
|
+
timeout_opts: ContextDev::WebWebCrawlMdParams::TimeoutOpts::OrHash,
|
|
362
405
|
url_regex: String,
|
|
363
406
|
use_main_content_only: T::Boolean,
|
|
364
407
|
wait_for_ms: Integer,
|
|
@@ -416,10 +459,10 @@ module ContextDev
|
|
|
416
459
|
stop_after_ms: nil,
|
|
417
460
|
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
418
461
|
tags: nil,
|
|
419
|
-
# Optional
|
|
420
|
-
#
|
|
421
|
-
#
|
|
422
|
-
|
|
462
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
463
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
464
|
+
# timeoutOpts object.
|
|
465
|
+
timeout_opts: nil,
|
|
423
466
|
# Regex pattern. Only URLs matching this pattern will be followed and scraped. An
|
|
424
467
|
# automatic prefix scope in the form ^<starting URL> follows a redirect of the
|
|
425
468
|
# starting page.
|
|
@@ -439,8 +482,62 @@ module ContextDev
|
|
|
439
482
|
)
|
|
440
483
|
end
|
|
441
484
|
|
|
485
|
+
# Downloads a resource and returns its bytes as base64. Supports images, PDFs,
|
|
486
|
+
# HTML pages, and any other content type without image conversion, text
|
|
487
|
+
# extraction, or character-encoding changes. HTTP compression is decoded before
|
|
488
|
+
# base64 encoding. HTML is the original HTTP response; JavaScript is not rendered.
|
|
489
|
+
# Follows public redirects and retries failed downloads through ISP and
|
|
490
|
+
# residential proxies, with a direct fallback. When country is specified, only a
|
|
491
|
+
# residential proxy in that country is used. Supply headers such as Referer for
|
|
492
|
+
# images that require a referring page. Downloads are not cached. Maximum decoded
|
|
493
|
+
# resource size: 20 MiB (20971520 bytes), before base64 encoding. Successful
|
|
494
|
+
# requests cost 1 credit; errors are not billed.
|
|
495
|
+
sig do
|
|
496
|
+
params(
|
|
497
|
+
url: String,
|
|
498
|
+
country: ContextDev::WebWebScrapeBytesParams::Country::OrSymbol,
|
|
499
|
+
headers: T::Hash[Symbol, String],
|
|
500
|
+
tags: T::Array[String],
|
|
501
|
+
timeout_opts:
|
|
502
|
+
ContextDev::WebWebScrapeBytesParams::TimeoutOpts::OrHash,
|
|
503
|
+
zdr: ContextDev::WebWebScrapeBytesParams::Zdr::OrSymbol,
|
|
504
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
505
|
+
).returns(ContextDev::Models::WebWebScrapeBytesResponse)
|
|
506
|
+
end
|
|
507
|
+
def web_scrape_bytes(
|
|
508
|
+
# Full HTTP(S) URL of the resource to download, such as an image, PDF, or page.
|
|
509
|
+
url:,
|
|
510
|
+
# Fetch the target page through a residential proxy in this country (ISO 3166-1
|
|
511
|
+
# alpha-2).
|
|
512
|
+
country: nil,
|
|
513
|
+
# Optional outbound HTTP headers, such as Referer, Cookie, or Authorization. Send
|
|
514
|
+
# as a JSON object or deep-object query params such as
|
|
515
|
+
# headers[Referer]=https://example.com/. Host, Content-Length, and hop-by-hop
|
|
516
|
+
# transport headers are rejected. Authorization and cookies are removed when a
|
|
517
|
+
# redirect changes origin.
|
|
518
|
+
headers: nil,
|
|
519
|
+
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
520
|
+
# characters.
|
|
521
|
+
tags: nil,
|
|
522
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
523
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
524
|
+
# timeoutOpts object.
|
|
525
|
+
timeout_opts: nil,
|
|
526
|
+
# Set to enabled to bypass shared caches and omit request and response content
|
|
527
|
+
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
528
|
+
# organization (contact support@context.dev), otherwise the request fails with
|
|
529
|
+
# ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
|
|
530
|
+
zdr: nil,
|
|
531
|
+
request_options: {}
|
|
532
|
+
)
|
|
533
|
+
end
|
|
534
|
+
|
|
442
535
|
# Scrapes the given URL and returns the raw HTML content of the page. The base
|
|
443
|
-
# request costs 1 credit; requests with browser actions cost 2 credits.
|
|
536
|
+
# request costs 1 credit; requests with browser actions cost 2 credits. A request
|
|
537
|
+
# that hits its timeoutOpts.milliseconds deadline fails with 408 and is not
|
|
538
|
+
# billed, unless timeoutOpts.behavior=return-partial is set — then the page as
|
|
539
|
+
# rendered so far is returned with `finalDOMState: "still-loading"` and billed at
|
|
540
|
+
# the base cost of 1 credit.
|
|
444
541
|
sig do
|
|
445
542
|
params(
|
|
446
543
|
url: String,
|
|
@@ -463,7 +560,7 @@ module ContextDev
|
|
|
463
560
|
pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash,
|
|
464
561
|
settle_animations: T::Boolean,
|
|
465
562
|
tags: T::Array[String],
|
|
466
|
-
|
|
563
|
+
timeout_opts: ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::OrHash,
|
|
467
564
|
use_main_content_only: T::Boolean,
|
|
468
565
|
wait_for_ms: T.nilable(Integer),
|
|
469
566
|
zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol,
|
|
@@ -508,15 +605,17 @@ module ContextDev
|
|
|
508
605
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
509
606
|
# characters.
|
|
510
607
|
tags: nil,
|
|
511
|
-
# Optional
|
|
512
|
-
#
|
|
513
|
-
#
|
|
514
|
-
|
|
608
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
609
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
610
|
+
# timeoutOpts object.
|
|
611
|
+
timeout_opts: nil,
|
|
515
612
|
# When true, return only the page's main content in the HTML response, excluding
|
|
516
613
|
# headers, footers, sidebars, and navigation when detectable.
|
|
517
614
|
use_main_content_only: nil,
|
|
518
615
|
# Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
|
|
519
|
-
# 30000 (30 seconds).
|
|
616
|
+
# 30000 (30 seconds). When combined with timeoutOpts, timeoutOpts.milliseconds
|
|
617
|
+
# must be at least waitForMs + 10000 ms; a shorter deadline is rejected with 400
|
|
618
|
+
# TIMEOUT_TOO_SHORT_FOR_WAIT.
|
|
520
619
|
wait_for_ms: nil,
|
|
521
620
|
# Set to enabled to bypass shared caches and omit request and response content
|
|
522
621
|
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
@@ -551,7 +650,8 @@ module ContextDev
|
|
|
551
650
|
headers: T::Hash[Symbol, String],
|
|
552
651
|
max_age_ms: T.nilable(Integer),
|
|
553
652
|
tags: T::Array[String],
|
|
554
|
-
|
|
653
|
+
timeout_opts:
|
|
654
|
+
ContextDev::WebWebScrapeImagesParams::TimeoutOpts::OrHash,
|
|
555
655
|
wait_for_ms: T.nilable(Integer),
|
|
556
656
|
request_options: ContextDev::RequestOptions::OrHash
|
|
557
657
|
).returns(ContextDev::Models::WebWebScrapeImagesResponse)
|
|
@@ -581,12 +681,14 @@ module ContextDev
|
|
|
581
681
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
582
682
|
# characters.
|
|
583
683
|
tags: nil,
|
|
584
|
-
# Optional
|
|
585
|
-
#
|
|
586
|
-
#
|
|
587
|
-
|
|
684
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
685
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
686
|
+
# timeoutOpts object.
|
|
687
|
+
timeout_opts: nil,
|
|
588
688
|
# Optional browser wait time in milliseconds after initial page load before
|
|
589
|
-
# collecting images. Min: 0. Max: 30000 (30 seconds).
|
|
689
|
+
# collecting images. Min: 0. Max: 30000 (30 seconds). When combined with
|
|
690
|
+
# timeoutOpts, timeoutOpts.milliseconds must be at least waitForMs + 10000 ms; a
|
|
691
|
+
# shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
|
|
590
692
|
wait_for_ms: nil,
|
|
591
693
|
request_options: {}
|
|
592
694
|
)
|
|
@@ -612,11 +714,11 @@ module ContextDev
|
|
|
612
714
|
#
|
|
613
715
|
# | HTTP status | Billed? | Meaning |
|
|
614
716
|
# | ----------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
615
|
-
# | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing
|
|
717
|
+
# | 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 |
|
|
616
718
|
# | 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 |
|
|
617
719
|
# | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
|
|
618
720
|
# | 404 | No | Target page returned or fingerprinted as not found |
|
|
619
|
-
# | 408 | No | Request timed out
|
|
721
|
+
# | 408 | No | Request timed out. With timeoutOpts.behavior=return-partial this only happens when nothing usable had rendered by the deadline |
|
|
620
722
|
# | 413 | No | Target content exceeds the maximum supported size (20 MB) |
|
|
621
723
|
# | 415 | No | Unsupported content type |
|
|
622
724
|
# | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
|
|
@@ -647,7 +749,7 @@ module ContextDev
|
|
|
647
749
|
settle_animations: T::Boolean,
|
|
648
750
|
shorten_base64_images: T::Boolean,
|
|
649
751
|
tags: T::Array[String],
|
|
650
|
-
|
|
752
|
+
timeout_opts: ContextDev::WebWebScrapeMdParams::TimeoutOpts::OrHash,
|
|
651
753
|
use_main_content_only: T::Boolean,
|
|
652
754
|
wait_for_ms: T.nilable(Integer),
|
|
653
755
|
zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol,
|
|
@@ -703,15 +805,17 @@ module ContextDev
|
|
|
703
805
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
704
806
|
# characters.
|
|
705
807
|
tags: nil,
|
|
706
|
-
# Optional
|
|
707
|
-
#
|
|
708
|
-
#
|
|
709
|
-
|
|
808
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
809
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
810
|
+
# timeoutOpts object.
|
|
811
|
+
timeout_opts: nil,
|
|
710
812
|
# Extract only the main content of the page, excluding headers, footers, sidebars,
|
|
711
813
|
# and navigation
|
|
712
814
|
use_main_content_only: nil,
|
|
713
815
|
# Optional browser wait time in milliseconds after initial page load before
|
|
714
|
-
# converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).
|
|
816
|
+
# converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). When combined
|
|
817
|
+
# with timeoutOpts, timeoutOpts.milliseconds must be at least waitForMs + 10000
|
|
818
|
+
# ms; a shorter deadline is rejected with 400 TIMEOUT_TOO_SHORT_FOR_WAIT.
|
|
715
819
|
wait_for_ms: nil,
|
|
716
820
|
# Set to enabled to bypass shared caches and omit request and response content
|
|
717
821
|
# from retained usage logs. Requires zero data retention to be enabled for your
|
|
@@ -737,7 +841,8 @@ module ContextDev
|
|
|
737
841
|
search: String,
|
|
738
842
|
sitemap_url: String,
|
|
739
843
|
tags: T::Array[String],
|
|
740
|
-
|
|
844
|
+
timeout_opts:
|
|
845
|
+
ContextDev::WebWebScrapeSitemapParams::TimeoutOpts::OrHash,
|
|
741
846
|
url_regex: String,
|
|
742
847
|
zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol,
|
|
743
848
|
request_options: ContextDev::RequestOptions::OrHash
|
|
@@ -766,10 +871,10 @@ module ContextDev
|
|
|
766
871
|
# Comma-separated tags for tracking request usage. Up to 20 tags, each 1-50
|
|
767
872
|
# characters.
|
|
768
873
|
tags: nil,
|
|
769
|
-
# Optional
|
|
770
|
-
#
|
|
771
|
-
#
|
|
772
|
-
|
|
874
|
+
# Optional request deadline and behavior on timeout. For GET requests, use
|
|
875
|
+
# timeoutOpts[milliseconds]=30000&timeoutOpts[behavior]=fail or a JSON-encoded
|
|
876
|
+
# timeoutOpts object.
|
|
877
|
+
timeout_opts: nil,
|
|
773
878
|
# Optional RE2-compatible regex pattern. Only URLs matching this pattern are
|
|
774
879
|
# returned and counted against maxLinks.
|
|
775
880
|
url_regex: nil,
|
data/sig/context_dev/client.rbs
CHANGED
|
@@ -5,7 +5,7 @@ module ContextDev
|
|
|
5
5
|
url: String,
|
|
6
6
|
max_age_ms: Integer,
|
|
7
7
|
tags: ::Array[String],
|
|
8
|
-
|
|
8
|
+
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts
|
|
9
9
|
}
|
|
10
10
|
& ContextDev::Internal::Type::request_parameters
|
|
11
11
|
|
|
@@ -23,15 +23,17 @@ module ContextDev
|
|
|
23
23
|
|
|
24
24
|
def tags=: (::Array[String]) -> ::Array[String]
|
|
25
25
|
|
|
26
|
-
attr_reader
|
|
26
|
+
attr_reader timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts?
|
|
27
27
|
|
|
28
|
-
def
|
|
28
|
+
def timeout_opts=: (
|
|
29
|
+
ContextDev::AIExtractProductParams::TimeoutOpts
|
|
30
|
+
) -> ContextDev::AIExtractProductParams::TimeoutOpts
|
|
29
31
|
|
|
30
32
|
def initialize: (
|
|
31
33
|
url: String,
|
|
32
34
|
?max_age_ms: Integer,
|
|
33
35
|
?tags: ::Array[String],
|
|
34
|
-
?
|
|
36
|
+
?timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts,
|
|
35
37
|
?request_options: ContextDev::request_opts
|
|
36
38
|
) -> void
|
|
37
39
|
|
|
@@ -39,9 +41,46 @@ module ContextDev
|
|
|
39
41
|
url: String,
|
|
40
42
|
max_age_ms: Integer,
|
|
41
43
|
tags: ::Array[String],
|
|
42
|
-
|
|
44
|
+
timeout_opts: ContextDev::AIExtractProductParams::TimeoutOpts,
|
|
43
45
|
request_options: ContextDev::RequestOptions
|
|
44
46
|
}
|
|
47
|
+
|
|
48
|
+
type timeout_opts =
|
|
49
|
+
{
|
|
50
|
+
milliseconds: Integer,
|
|
51
|
+
behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
class TimeoutOpts < ContextDev::Internal::Type::BaseModel
|
|
55
|
+
attr_accessor milliseconds: Integer
|
|
56
|
+
|
|
57
|
+
attr_reader behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior?
|
|
58
|
+
|
|
59
|
+
def behavior=: (
|
|
60
|
+
ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
61
|
+
) -> ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
62
|
+
|
|
63
|
+
def initialize: (
|
|
64
|
+
milliseconds: Integer,
|
|
65
|
+
?behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
66
|
+
) -> void
|
|
67
|
+
|
|
68
|
+
def to_hash: -> {
|
|
69
|
+
milliseconds: Integer,
|
|
70
|
+
behavior: ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type behavior = :fail | :"return-partial"
|
|
74
|
+
|
|
75
|
+
module Behavior
|
|
76
|
+
extend ContextDev::Internal::Type::Enum
|
|
77
|
+
|
|
78
|
+
FAIL: :fail
|
|
79
|
+
RETURN_PARTIAL: :"return-partial"
|
|
80
|
+
|
|
81
|
+
def self?.values: -> ::Array[ContextDev::Models::AIExtractProductParams::TimeoutOpts::behavior]
|
|
82
|
+
end
|
|
83
|
+
end
|
|
45
84
|
end
|
|
46
85
|
end
|
|
47
86
|
end
|
|
@@ -3,8 +3,10 @@ module ContextDev
|
|
|
3
3
|
type ai_extract_product_response =
|
|
4
4
|
{
|
|
5
5
|
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
6
|
+
request_id: String,
|
|
6
7
|
is_product_page: bool,
|
|
7
8
|
key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
9
|
+
partial: bool,
|
|
8
10
|
platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
9
11
|
product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
10
12
|
}
|
|
@@ -12,6 +14,8 @@ module ContextDev
|
|
|
12
14
|
class AIExtractProductResponse < ContextDev::Internal::Type::BaseModel
|
|
13
15
|
attr_accessor cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata
|
|
14
16
|
|
|
17
|
+
attr_accessor request_id: String
|
|
18
|
+
|
|
15
19
|
attr_reader is_product_page: bool?
|
|
16
20
|
|
|
17
21
|
def is_product_page=: (bool) -> bool
|
|
@@ -22,22 +26,30 @@ module ContextDev
|
|
|
22
26
|
ContextDev::Models::AIExtractProductResponse::KeyMetadata
|
|
23
27
|
) -> ContextDev::Models::AIExtractProductResponse::KeyMetadata
|
|
24
28
|
|
|
29
|
+
attr_reader partial: bool?
|
|
30
|
+
|
|
31
|
+
def partial=: (bool) -> bool
|
|
32
|
+
|
|
25
33
|
attr_accessor platform: ContextDev::Models::AIExtractProductResponse::platform?
|
|
26
34
|
|
|
27
35
|
attr_accessor product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
28
36
|
|
|
29
37
|
def initialize: (
|
|
30
38
|
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
39
|
+
request_id: String,
|
|
31
40
|
?is_product_page: bool,
|
|
32
41
|
?key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
42
|
+
?partial: bool,
|
|
33
43
|
?platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
34
44
|
?product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
35
45
|
) -> void
|
|
36
46
|
|
|
37
47
|
def to_hash: -> {
|
|
38
48
|
cache_metadata: ContextDev::Models::AIExtractProductResponse::CacheMetadata,
|
|
49
|
+
request_id: String,
|
|
39
50
|
is_product_page: bool,
|
|
40
51
|
key_metadata: ContextDev::Models::AIExtractProductResponse::KeyMetadata,
|
|
52
|
+
partial: bool,
|
|
41
53
|
platform: ContextDev::Models::AIExtractProductResponse::platform?,
|
|
42
54
|
product: ContextDev::Models::AIExtractProductResponse::Product?
|
|
43
55
|
}
|