context.dev 2.16.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.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/models/ai_extract_product_params.rb +53 -8
  5. data/lib/context_dev/models/ai_extract_product_response.rb +10 -1
  6. data/lib/context_dev/models/ai_extract_products_params.rb +116 -16
  7. data/lib/context_dev/models/ai_extract_products_response.rb +11 -1
  8. data/lib/context_dev/models/brand_retrieve_params.rb +355 -60
  9. data/lib/context_dev/models/brand_retrieve_response.rb +10 -1
  10. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +57 -11
  11. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +10 -1
  12. data/lib/context_dev/models/industry_retrieve_naics_params.rb +53 -8
  13. data/lib/context_dev/models/industry_retrieve_naics_response.rb +10 -1
  14. data/lib/context_dev/models/industry_retrieve_sic_params.rb +53 -8
  15. data/lib/context_dev/models/industry_retrieve_sic_response.rb +10 -1
  16. data/lib/context_dev/models/monitor_create_params.rb +27 -3
  17. data/lib/context_dev/models/monitor_create_response.rb +30 -5
  18. data/lib/context_dev/models/monitor_list_response.rb +30 -5
  19. data/lib/context_dev/models/monitor_retrieve_response.rb +30 -5
  20. data/lib/context_dev/models/monitor_update_params.rb +27 -3
  21. data/lib/context_dev/models/monitor_update_response.rb +30 -5
  22. data/lib/context_dev/models/person_enrich_params.rb +53 -8
  23. data/lib/context_dev/models/person_enrich_response.rb +10 -1
  24. data/lib/context_dev/models/utility_prefetch_params.rb +48 -8
  25. data/lib/context_dev/models/web_answers_params.rb +124 -0
  26. data/lib/context_dev/models/web_answers_response.rb +68 -0
  27. data/lib/context_dev/models/web_extract_competitors_params.rb +53 -8
  28. data/lib/context_dev/models/web_extract_competitors_response.rb +10 -1
  29. data/lib/context_dev/models/web_extract_fonts_params.rb +58 -11
  30. data/lib/context_dev/models/web_extract_fonts_response.rb +32 -1
  31. data/lib/context_dev/models/web_extract_params.rb +53 -8
  32. data/lib/context_dev/models/web_extract_response.rb +10 -1
  33. data/lib/context_dev/models/web_extract_styleguide_params.rb +58 -11
  34. data/lib/context_dev/models/web_extract_styleguide_response.rb +32 -1
  35. data/lib/context_dev/models/web_screenshot_params.rb +58 -10
  36. data/lib/context_dev/models/web_screenshot_response.rb +32 -1
  37. data/lib/context_dev/models/web_search_params.rb +112 -16
  38. data/lib/context_dev/models/web_search_response.rb +43 -2
  39. data/lib/context_dev/models/web_web_crawl_md_params.rb +53 -8
  40. data/lib/context_dev/models/web_web_crawl_md_response.rb +11 -1
  41. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +344 -0
  42. data/lib/context_dev/models/web_web_scrape_bytes_response.rb +135 -0
  43. data/lib/context_dev/models/web_web_scrape_html_params.rb +57 -10
  44. data/lib/context_dev/models/web_web_scrape_html_response.rb +32 -1
  45. data/lib/context_dev/models/web_web_scrape_images_params.rb +57 -10
  46. data/lib/context_dev/models/web_web_scrape_images_response.rb +42 -1
  47. data/lib/context_dev/models/web_web_scrape_md_params.rb +57 -10
  48. data/lib/context_dev/models/web_web_scrape_md_response.rb +32 -1
  49. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +53 -8
  50. data/lib/context_dev/models/web_web_scrape_sitemap_response.rb +11 -1
  51. data/lib/context_dev/models.rb +4 -0
  52. data/lib/context_dev/resources/ai.rb +2 -2
  53. data/lib/context_dev/resources/brand.rb +3 -3
  54. data/lib/context_dev/resources/industry.rb +6 -6
  55. data/lib/context_dev/resources/people.rb +2 -2
  56. data/lib/context_dev/resources/utility.rb +2 -2
  57. data/lib/context_dev/resources/web.rb +119 -33
  58. data/lib/context_dev/version.rb +1 -1
  59. data/lib/context_dev.rb +4 -0
  60. data/rbi/context_dev/models/ai_extract_product_params.rbi +125 -13
  61. data/rbi/context_dev/models/ai_extract_product_response.rbi +13 -0
  62. data/rbi/context_dev/models/ai_extract_products_params.rbi +264 -26
  63. data/rbi/context_dev/models/ai_extract_products_response.rbi +15 -0
  64. data/rbi/context_dev/models/brand_retrieve_params.rbi +816 -102
  65. data/rbi/context_dev/models/brand_retrieve_response.rbi +13 -0
  66. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +136 -19
  67. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +13 -0
  68. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +127 -13
  69. data/rbi/context_dev/models/industry_retrieve_naics_response.rbi +13 -0
  70. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +127 -13
  71. data/rbi/context_dev/models/industry_retrieve_sic_response.rbi +13 -0
  72. data/rbi/context_dev/models/monitor_create_params.rbi +40 -2
  73. data/rbi/context_dev/models/monitor_create_response.rbi +44 -4
  74. data/rbi/context_dev/models/monitor_list_response.rbi +44 -4
  75. data/rbi/context_dev/models/monitor_retrieve_response.rbi +44 -4
  76. data/rbi/context_dev/models/monitor_update_params.rbi +40 -2
  77. data/rbi/context_dev/models/monitor_update_response.rbi +44 -4
  78. data/rbi/context_dev/models/person_enrich_params.rbi +123 -13
  79. data/rbi/context_dev/models/person_enrich_response.rbi +16 -3
  80. data/rbi/context_dev/models/utility_prefetch_params.rbi +112 -13
  81. data/rbi/context_dev/models/web_answers_params.rbi +234 -0
  82. data/rbi/context_dev/models/web_answers_response.rbi +122 -0
  83. data/rbi/context_dev/models/web_extract_competitors_params.rbi +127 -13
  84. data/rbi/context_dev/models/web_extract_competitors_response.rbi +16 -3
  85. data/rbi/context_dev/models/web_extract_fonts_params.rbi +132 -19
  86. data/rbi/context_dev/models/web_extract_fonts_response.rbi +71 -0
  87. data/rbi/context_dev/models/web_extract_params.rbi +120 -13
  88. data/rbi/context_dev/models/web_extract_response.rbi +16 -3
  89. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +136 -19
  90. data/rbi/context_dev/models/web_extract_styleguide_response.rbi +71 -0
  91. data/rbi/context_dev/models/web_screenshot_params.rbi +132 -17
  92. data/rbi/context_dev/models/web_screenshot_response.rbi +71 -0
  93. data/rbi/context_dev/models/web_search_params.rbi +253 -26
  94. data/rbi/context_dev/models/web_search_response.rbi +92 -6
  95. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +123 -13
  96. data/rbi/context_dev/models/web_web_crawl_md_response.rbi +19 -3
  97. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +699 -0
  98. data/rbi/context_dev/models/web_web_scrape_bytes_response.rbi +238 -0
  99. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +132 -17
  100. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +61 -0
  101. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +134 -17
  102. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +89 -3
  103. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +130 -17
  104. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +61 -0
  105. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +127 -13
  106. data/rbi/context_dev/models/web_web_scrape_sitemap_response.rbi +18 -3
  107. data/rbi/context_dev/models.rbi +4 -0
  108. data/rbi/context_dev/resources/ai.rbi +5 -5
  109. data/rbi/context_dev/resources/brand.rbi +9 -8
  110. data/rbi/context_dev/resources/industry.rbi +12 -10
  111. data/rbi/context_dev/resources/people.rbi +5 -5
  112. data/rbi/context_dev/resources/utility.rbi +5 -5
  113. data/rbi/context_dev/resources/web.rbi +170 -72
  114. data/sig/context_dev/models/ai_extract_product_params.rbs +44 -5
  115. data/sig/context_dev/models/ai_extract_product_response.rbs +7 -0
  116. data/sig/context_dev/models/ai_extract_products_params.rbs +88 -10
  117. data/sig/context_dev/models/ai_extract_products_response.rbs +7 -0
  118. data/sig/context_dev/models/brand_retrieve_params.rbs +264 -30
  119. data/sig/context_dev/models/brand_retrieve_response.rbs +7 -0
  120. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +44 -5
  121. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +7 -0
  122. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +44 -5
  123. data/sig/context_dev/models/industry_retrieve_naics_response.rbs +7 -0
  124. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +44 -5
  125. data/sig/context_dev/models/industry_retrieve_sic_response.rbs +7 -0
  126. data/sig/context_dev/models/monitor_create_params.rbs +14 -0
  127. data/sig/context_dev/models/monitor_create_response.rbs +14 -0
  128. data/sig/context_dev/models/monitor_list_response.rbs +14 -0
  129. data/sig/context_dev/models/monitor_retrieve_response.rbs +14 -0
  130. data/sig/context_dev/models/monitor_update_params.rbs +14 -0
  131. data/sig/context_dev/models/monitor_update_response.rbs +14 -0
  132. data/sig/context_dev/models/person_enrich_params.rbs +44 -5
  133. data/sig/context_dev/models/person_enrich_response.rbs +10 -3
  134. data/sig/context_dev/models/utility_prefetch_params.rbs +43 -5
  135. data/sig/context_dev/models/web_answers_params.rbs +106 -0
  136. data/sig/context_dev/models/web_answers_response.rbs +60 -0
  137. data/sig/context_dev/models/web_extract_competitors_params.rbs +44 -5
  138. data/sig/context_dev/models/web_extract_competitors_response.rbs +10 -3
  139. data/sig/context_dev/models/web_extract_fonts_params.rbs +44 -5
  140. data/sig/context_dev/models/web_extract_fonts_response.rbs +20 -0
  141. data/sig/context_dev/models/web_extract_params.rbs +44 -5
  142. data/sig/context_dev/models/web_extract_response.rbs +10 -3
  143. data/sig/context_dev/models/web_extract_styleguide_params.rbs +44 -5
  144. data/sig/context_dev/models/web_extract_styleguide_response.rbs +20 -0
  145. data/sig/context_dev/models/web_screenshot_params.rbs +44 -5
  146. data/sig/context_dev/models/web_screenshot_response.rbs +20 -0
  147. data/sig/context_dev/models/web_search_params.rbs +88 -10
  148. data/sig/context_dev/models/web_search_response.rbs +33 -6
  149. data/sig/context_dev/models/web_web_crawl_md_params.rbs +44 -5
  150. data/sig/context_dev/models/web_web_crawl_md_response.rbs +10 -3
  151. data/sig/context_dev/models/web_web_scrape_bytes_params.rbs +531 -0
  152. data/sig/context_dev/models/web_web_scrape_bytes_response.rbs +108 -0
  153. data/sig/context_dev/models/web_web_scrape_html_params.rbs +44 -5
  154. data/sig/context_dev/models/web_web_scrape_html_response.rbs +16 -0
  155. data/sig/context_dev/models/web_web_scrape_images_params.rbs +44 -5
  156. data/sig/context_dev/models/web_web_scrape_images_response.rbs +30 -3
  157. data/sig/context_dev/models/web_web_scrape_md_params.rbs +44 -5
  158. data/sig/context_dev/models/web_web_scrape_md_response.rbs +16 -0
  159. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +44 -5
  160. data/sig/context_dev/models/web_web_scrape_sitemap_response.rbs +10 -3
  161. data/sig/context_dev/models.rbs +4 -0
  162. data/sig/context_dev/resources/ai.rbs +1 -1
  163. data/sig/context_dev/resources/brand.rbs +1 -1
  164. data/sig/context_dev/resources/industry.rbs +2 -2
  165. data/sig/context_dev/resources/people.rbs +1 -1
  166. data/sig/context_dev/resources/utility.rbs +1 -1
  167. data/sig/context_dev/resources/web.rbs +30 -11
  168. metadata +14 -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, timeout_ms: nil, wait_for_ms: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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, timeout_ms: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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", timeout_ms: "timeoutMS"),
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, timeout_ms: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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
- timeout_ms: "timeoutMS"
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, timeout_ms: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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
- timeout_ms: "timeoutMS"
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, timeout_ms: nil, viewport: nil, wait_for_ms: nil, zdr: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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
- timeout_ms: "timeoutMS",
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, timeout_ms: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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
- timeout_ms: "timeoutMS",
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, timeout_ms: nil, wait_for_ms: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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
- timeout_ms: "timeoutMS",
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, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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
- timeout_ms: "timeoutMS",
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, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {})
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 timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
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
- timeout_ms: "timeoutMS",
699
+ timeout_opts: "timeoutOpts",
614
700
  url_regex: "urlRegex"
615
701
  ),
616
702
  model: ContextDev::Models::WebWebScrapeSitemapResponse,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "2.16.0"
4
+ VERSION = "2.17.0"
5
5
  end
data/lib/context_dev.rb CHANGED
@@ -122,6 +122,8 @@ require_relative "context_dev/models/person_enrich_response"
122
122
  require_relative "context_dev/models/retry_config"
123
123
  require_relative "context_dev/models/utility_prefetch_params"
124
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"
125
127
  require_relative "context_dev/models/web_extract_competitors_params"
126
128
  require_relative "context_dev/models/web_extract_competitors_response"
127
129
  require_relative "context_dev/models/web_extract_fonts_params"
@@ -147,6 +149,8 @@ require_relative "context_dev/models/web_search_params"
147
149
  require_relative "context_dev/models/web_search_response"
148
150
  require_relative "context_dev/models/web_web_crawl_md_params"
149
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"
150
154
  require_relative "context_dev/models/web_web_scrape_html_params"
151
155
  require_relative "context_dev/models/web_web_scrape_html_response"
152
156
  require_relative "context_dev/models/web_web_scrape_images_params"
@@ -34,21 +34,27 @@ module ContextDev
34
34
  sig { params(tags: T::Array[String]).void }
35
35
  attr_writer :tags
36
36
 
37
- # Optional timeout in milliseconds for the request. If the request takes longer
38
- # than this value, it will be aborted with a 408 status code. Maximum allowed
39
- # value is 300000ms (5 minutes).
40
- sig { returns(T.nilable(Integer)) }
41
- attr_reader :timeout_ms
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 { params(timeout_ms: Integer).void }
44
- attr_writer :timeout_ms
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
- timeout_ms: Integer,
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 timeout in milliseconds for the request. If the request takes longer
65
- # than this value, it will be aborted with a 408 status code. Maximum allowed
66
- # value is 300000ms (5 minutes).
67
- timeout_ms: nil,
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
- timeout_ms: Integer,
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
@@ -55,6 +55,14 @@ module ContextDev
55
55
  end
56
56
  attr_writer :key_metadata
57
57
 
58
+ # True when the timeout ended processing and this response contains only usable
59
+ # results completed so far. Unfinished results are omitted.
60
+ sig { returns(T.nilable(T::Boolean)) }
61
+ attr_reader :partial
62
+
63
+ sig { params(partial: T::Boolean).void }
64
+ attr_writer :partial
65
+
58
66
  # The detected ecommerce platform, or null if not a product page
59
67
  sig do
60
68
  returns(
@@ -91,6 +99,7 @@ module ContextDev
91
99
  is_product_page: T::Boolean,
92
100
  key_metadata:
93
101
  ContextDev::Models::AIExtractProductResponse::KeyMetadata::OrHash,
102
+ partial: T::Boolean,
94
103
  platform:
95
104
  T.nilable(
96
105
  ContextDev::Models::AIExtractProductResponse::Platform::OrSymbol
@@ -113,6 +122,9 @@ module ContextDev
113
122
  is_product_page: nil,
114
123
  # Credit usage, included whenever a valid API key is provided.
115
124
  key_metadata: nil,
125
+ # True when the timeout ended processing and this response contains only usable
126
+ # results completed so far. Unfinished results are omitted.
127
+ partial: nil,
116
128
  # The detected ecommerce platform, or null if not a product page
117
129
  platform: nil,
118
130
  # The extracted product data, or null if not a product page
@@ -129,6 +141,7 @@ module ContextDev
129
141
  is_product_page: T::Boolean,
130
142
  key_metadata:
131
143
  ContextDev::Models::AIExtractProductResponse::KeyMetadata,
144
+ partial: T::Boolean,
132
145
  platform:
133
146
  T.nilable(
134
147
  ContextDev::Models::AIExtractProductResponse::Platform::TaggedSymbol