context.dev 2.4.0 → 2.6.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 (187) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +4 -0
  5. data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
  6. data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
  7. data/lib/context_dev/models/batch_cancel_params.rb +22 -0
  8. data/lib/context_dev/models/batch_cancel_response.rb +354 -0
  9. data/lib/context_dev/models/batch_get_results_params.rb +42 -0
  10. data/lib/context_dev/models/batch_get_results_response.rb +463 -0
  11. data/lib/context_dev/models/batch_list_params.rb +94 -0
  12. data/lib/context_dev/models/batch_list_response.rb +388 -0
  13. data/lib/context_dev/models/batch_retrieve_params.rb +22 -0
  14. data/lib/context_dev/models/batch_retrieve_response.rb +390 -0
  15. data/lib/context_dev/models/batch_submit_params.rb +56 -0
  16. data/lib/context_dev/models/batch_submit_response.rb +614 -0
  17. data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
  18. data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
  19. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
  20. data/lib/context_dev/models/error.rb +26 -0
  21. data/lib/context_dev/models/error_count.rb +26 -0
  22. data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
  23. data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
  24. data/lib/context_dev/models/monitor_create_params.rb +147 -132
  25. data/lib/context_dev/models/monitor_create_response.rb +40 -15
  26. data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
  27. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
  28. data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
  29. data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
  30. data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
  31. data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
  32. data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
  33. data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
  34. data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
  35. data/lib/context_dev/models/monitor_list_params.rb +18 -19
  36. data/lib/context_dev/models/monitor_list_response.rb +27 -12
  37. data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
  38. data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
  39. data/lib/context_dev/models/monitor_retrieve_response.rb +27 -12
  40. data/lib/context_dev/models/monitor_update_params.rb +27 -12
  41. data/lib/context_dev/models/monitor_update_response.rb +27 -12
  42. data/lib/context_dev/models/parse_handle_params.rb +199 -33
  43. data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
  44. data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
  45. data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
  46. data/lib/context_dev/models/web_extract_params.rb +19 -1
  47. data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
  48. data/lib/context_dev/models/web_screenshot_params.rb +69 -18
  49. data/lib/context_dev/models/web_screenshot_response.rb +3 -2
  50. data/lib/context_dev/models/web_search_params.rb +9 -1
  51. data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
  52. data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
  53. data/lib/context_dev/models/web_web_scrape_html_response.rb +93 -1
  54. data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
  55. data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
  56. data/lib/context_dev/models/web_web_scrape_md_response.rb +93 -1
  57. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
  58. data/lib/context_dev/models.rb +18 -0
  59. data/lib/context_dev/resources/ai.rb +3 -1
  60. data/lib/context_dev/resources/batch.rb +155 -0
  61. data/lib/context_dev/resources/brand.rb +6 -2
  62. data/lib/context_dev/resources/industry.rb +6 -2
  63. data/lib/context_dev/resources/monitors.rb +75 -37
  64. data/lib/context_dev/resources/parse.rb +15 -11
  65. data/lib/context_dev/resources/utility.rb +3 -1
  66. data/lib/context_dev/resources/web.rb +104 -55
  67. data/lib/context_dev/version.rb +1 -1
  68. data/lib/context_dev.rb +17 -0
  69. data/rbi/context_dev/client.rbi +3 -0
  70. data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
  71. data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
  72. data/rbi/context_dev/models/batch_cancel_params.rbi +40 -0
  73. data/rbi/context_dev/models/batch_cancel_response.rbi +642 -0
  74. data/rbi/context_dev/models/batch_get_results_params.rbi +70 -0
  75. data/rbi/context_dev/models/batch_get_results_response.rbi +848 -0
  76. data/rbi/context_dev/models/batch_list_params.rbi +166 -0
  77. data/rbi/context_dev/models/batch_list_response.rbi +738 -0
  78. data/rbi/context_dev/models/batch_retrieve_params.rbi +40 -0
  79. data/rbi/context_dev/models/batch_retrieve_response.rbi +707 -0
  80. data/rbi/context_dev/models/batch_submit_params.rbi +105 -0
  81. data/rbi/context_dev/models/batch_submit_response.rbi +1330 -0
  82. data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
  83. data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
  84. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
  85. data/rbi/context_dev/models/error.rbi +32 -0
  86. data/rbi/context_dev/models/error_count.rbi +34 -0
  87. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
  88. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
  89. data/rbi/context_dev/models/monitor_create_params.rbi +280 -246
  90. data/rbi/context_dev/models/monitor_create_response.rbi +44 -11
  91. data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
  92. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
  93. data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
  94. data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
  95. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
  96. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
  97. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
  98. data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
  99. data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
  100. data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
  101. data/rbi/context_dev/models/monitor_list_response.rbi +30 -9
  102. data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
  103. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
  104. data/rbi/context_dev/models/monitor_retrieve_response.rbi +30 -9
  105. data/rbi/context_dev/models/monitor_update_params.rbi +30 -9
  106. data/rbi/context_dev/models/monitor_update_response.rbi +30 -9
  107. data/rbi/context_dev/models/parse_handle_params.rbi +400 -46
  108. data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
  109. data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
  110. data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
  111. data/rbi/context_dev/models/web_extract_params.rbi +26 -0
  112. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
  113. data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
  114. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
  115. data/rbi/context_dev/models/web_search_params.rbi +11 -0
  116. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
  117. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
  118. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +182 -0
  119. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
  120. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
  121. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +180 -0
  122. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
  123. data/rbi/context_dev/models.rbi +18 -0
  124. data/rbi/context_dev/resources/ai.rbi +3 -0
  125. data/rbi/context_dev/resources/batch.rbi +120 -0
  126. data/rbi/context_dev/resources/brand.rbi +9 -1
  127. data/rbi/context_dev/resources/industry.rbi +10 -0
  128. data/rbi/context_dev/resources/monitors.rbi +67 -23
  129. data/rbi/context_dev/resources/parse.rbi +46 -19
  130. data/rbi/context_dev/resources/utility.rbi +3 -0
  131. data/rbi/context_dev/resources/web.rbi +224 -48
  132. data/sig/context_dev/client.rbs +2 -0
  133. data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
  134. data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
  135. data/sig/context_dev/models/batch_cancel_params.rbs +23 -0
  136. data/sig/context_dev/models/batch_cancel_response.rbs +266 -0
  137. data/sig/context_dev/models/batch_get_results_params.rbs +36 -0
  138. data/sig/context_dev/models/batch_get_results_response.rbs +399 -0
  139. data/sig/context_dev/models/batch_list_params.rbs +94 -0
  140. data/sig/context_dev/models/batch_list_response.rbs +304 -0
  141. data/sig/context_dev/models/batch_retrieve_params.rbs +23 -0
  142. data/sig/context_dev/models/batch_retrieve_response.rbs +290 -0
  143. data/sig/context_dev/models/batch_submit_params.rbs +52 -0
  144. data/sig/context_dev/models/batch_submit_response.rbs +542 -0
  145. data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
  146. data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
  147. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
  148. data/sig/context_dev/models/error.rbs +15 -0
  149. data/sig/context_dev/models/error_count.rbs +15 -0
  150. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
  151. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
  152. data/sig/context_dev/models/monitor_create_params.rbs +117 -97
  153. data/sig/context_dev/models/monitor_create_response.rbs +18 -1
  154. data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
  155. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
  156. data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
  157. data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
  158. data/sig/context_dev/models/monitor_list_params.rbs +8 -14
  159. data/sig/context_dev/models/monitor_list_response.rbs +13 -1
  160. data/sig/context_dev/models/monitor_retrieve_response.rbs +13 -1
  161. data/sig/context_dev/models/monitor_update_params.rbs +13 -1
  162. data/sig/context_dev/models/monitor_update_response.rbs +13 -1
  163. data/sig/context_dev/models/parse_handle_params.rbs +124 -25
  164. data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
  165. data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
  166. data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
  167. data/sig/context_dev/models/web_extract_params.rbs +14 -0
  168. data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
  169. data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
  170. data/sig/context_dev/models/web_search_params.rbs +7 -0
  171. data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
  172. data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
  173. data/sig/context_dev/models/web_web_scrape_html_response.rbs +85 -0
  174. data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
  175. data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
  176. data/sig/context_dev/models/web_web_scrape_md_response.rbs +85 -0
  177. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
  178. data/sig/context_dev/models.rbs +18 -0
  179. data/sig/context_dev/resources/ai.rbs +1 -0
  180. data/sig/context_dev/resources/batch.rbs +41 -0
  181. data/sig/context_dev/resources/brand.rbs +3 -1
  182. data/sig/context_dev/resources/industry.rbs +2 -0
  183. data/sig/context_dev/resources/monitors.rbs +14 -4
  184. data/sig/context_dev/resources/parse.rbs +8 -5
  185. data/sig/context_dev/resources/utility.rbs +1 -0
  186. data/sig/context_dev/resources/web.rbs +47 -26
  187. metadata +53 -2
@@ -9,7 +9,7 @@ module ContextDev
9
9
  # Crawl a website, use the provided JSON Schema and instructions to prioritize
10
10
  # relevant internal links, and extract structured data from the selected pages.
11
11
  #
12
- # @overload extract(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, stop_after_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
12
+ # @overload extract(schema:, url:, 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: {})
13
13
  #
14
14
  # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. TypeScript Zod users can pass a JSON S
15
15
  #
@@ -31,8 +31,12 @@ module ContextDev
31
31
  #
32
32
  # @param pdf [ContextDev::Models::WebExtractParams::Pdf]
33
33
  #
34
+ # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr
35
+ #
34
36
  # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (1
35
37
  #
38
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
39
+ #
36
40
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
37
41
  #
38
42
  # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw
@@ -59,12 +63,14 @@ module ContextDev
59
63
  # Analyze a company's landing page and web search evidence to return direct
60
64
  # competitors for the same product or market.
61
65
  #
62
- # @overload extract_competitors(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
66
+ # @overload extract_competitors(domain:, num_competitors: nil, tags: nil, timeout_ms: nil, request_options: {})
63
67
  #
64
68
  # @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
65
69
  #
66
70
  # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
67
71
  #
72
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
73
+ #
68
74
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
69
75
  #
70
76
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -90,13 +96,15 @@ module ContextDev
90
96
  # Scrape font information from a website including font families, usage
91
97
  # statistics, fallbacks, and element/word counts.
92
98
  #
93
- # @overload extract_fonts(direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {})
99
+ # @overload extract_fonts(direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {})
94
100
  #
95
101
  # @param direct_url [String] A specific URL to fetch fonts from directly, bypassing domain resolution (e.g.,
96
102
  #
97
103
  # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai
98
104
  #
99
- # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre
105
+ # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard
106
+ #
107
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
100
108
  #
101
109
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
102
110
  #
@@ -127,7 +135,7 @@ module ContextDev
127
135
  # Extract a comprehensive design system from a website including colors,
128
136
  # typography, spacing, shadows, and UI components.
129
137
  #
130
- # @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {})
138
+ # @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {})
131
139
  #
132
140
  # @param color_scheme [Symbol, ContextDev::Models::WebExtractStyleguideParams::ColorScheme] Optional browser color scheme to emulate for websites that respond to prefers-co
133
141
  #
@@ -135,7 +143,9 @@ module ContextDev
135
143
  #
136
144
  # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
137
145
  #
138
- # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre
146
+ # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard
147
+ #
148
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
139
149
  #
140
150
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
141
151
  #
@@ -166,11 +176,11 @@ module ContextDev
166
176
  #
167
177
  # Capture a screenshot of a website.
168
178
  #
169
- # @overload screenshot(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, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {})
179
+ # @overload screenshot(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: {})
170
180
  #
171
181
  # @param color_scheme [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig
172
182
  #
173
- # @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe
183
+ # @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r
174
184
  #
175
185
  # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https
176
186
  #
@@ -178,19 +188,23 @@ module ContextDev
178
188
  #
179
189
  # @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc
180
190
  #
181
- # @param handle_cookie_popup [Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup] Optional parameter to control cookie/consent popup handling. If 'true', we dismi
191
+ # @param handle_cookie_popup [Boolean, Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup] Optional parameter to control cookie/consent popup handling. If 'true', we dismi
182
192
  #
183
- # @param max_age_ms [Integer] Return a cached screenshot if a prior screenshot for the same parameters exists
193
+ # @param max_age_ms [Integer, nil] Return a cached screenshot if a prior screenshot for the same parameters exists
184
194
  #
185
195
  # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy
186
196
  #
187
- # @param scroll_offset [Integer] Optional vertical scroll offset in pixels for capturing a long page in viewport-
197
+ # @param scroll_offset [Integer, nil] Optional vertical scroll offset in pixels for capturing a long page in viewport-
198
+ #
199
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
188
200
  #
189
201
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
190
202
  #
191
203
  # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
192
204
  #
193
- # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before taking
205
+ # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before taking
206
+ #
207
+ # @param zdr [Symbol, ContextDev::Models::WebScreenshotParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
194
208
  #
195
209
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
196
210
  #
@@ -223,7 +237,7 @@ module ContextDev
223
237
  #
224
238
  # Search the web and optionally scrape each result to Markdown in one round-trip.
225
239
  #
226
- # @overload search(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, timeout_ms: nil, request_options: {})
240
+ # @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: {})
227
241
  #
228
242
  # @param query [String] Search query. Accepts natural language as well as Google-style search operators
229
243
  #
@@ -241,6 +255,8 @@ module ContextDev
241
255
  #
242
256
  # @param query_fanout [Boolean] Expand the query into multiple parallel variants for broader recall.
243
257
  #
258
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
259
+ #
244
260
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
245
261
  #
246
262
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -265,7 +281,7 @@ module ContextDev
265
281
  # Performs a crawl starting from a given URL, extracts page content as Markdown,
266
282
  # and returns results for all crawled pages.
267
283
  #
268
- # @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, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
284
+ # @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: {})
269
285
  #
270
286
  # @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
271
287
  #
@@ -297,6 +313,8 @@ module ContextDev
297
313
  #
298
314
  # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. After each scrape, the crawler c
299
315
  #
316
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
317
+ #
300
318
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
301
319
  #
302
320
  # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped.
@@ -305,6 +323,8 @@ module ContextDev
305
323
  #
306
324
  # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw
307
325
  #
326
+ # @param zdr [Symbol, ContextDev::Models::WebWebCrawlMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
327
+ #
308
328
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
309
329
  #
310
330
  # @return [ContextDev::Models::WebWebCrawlMdResponse]
@@ -324,33 +344,40 @@ module ContextDev
324
344
  # Some parameter documentations has been truncated, see
325
345
  # {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
326
346
  #
327
- # Scrapes the given URL and returns the raw HTML content of the page.
347
+ # Scrapes the given URL and returns the raw HTML content of the page. The base
348
+ # request costs 1 credit; requests with browser actions cost 2 credits.
328
349
  #
329
- # @overload web_scrape_html(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
350
+ # @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: {})
330
351
  #
331
352
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
332
353
  #
333
- # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe
354
+ # @param actions [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
355
+ #
356
+ # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r
334
357
  #
335
- # @param exclude_selectors [Array<String>] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
358
+ # @param exclude_selectors [Array<String>, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
336
359
  #
337
360
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
338
361
  #
339
- # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
362
+ # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames] When true, iframes are rendered inline into the returned HTML.
340
363
  #
341
- # @param include_selectors [Array<String>] CSS selectors. When provided, only matching subtrees (and their descendants) are
364
+ # @param include_selectors [Array<String>, nil] CSS selectors. When provided, only matching subtrees (and their descendants) are
342
365
  #
343
- # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
366
+ # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y
344
367
  #
345
368
  # @param pdf [ContextDev::Models::WebWebScrapeHTMLParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image
346
369
  #
347
- # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr
370
+ # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before extr
371
+ #
372
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
348
373
  #
349
374
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
350
375
  #
351
- # @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h
376
+ # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly] When true, return only the page's main content in the HTML response, excluding h
352
377
  #
353
- # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
378
+ # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max:
379
+ #
380
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
354
381
  #
355
382
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
356
383
  #
@@ -383,24 +410,29 @@ module ContextDev
383
410
  #
384
411
  # Extract image assets from a web page, including standard URLs, inline SVGs, data
385
412
  # URIs, responsive image sources, metadata, CSS backgrounds, video posters, and
386
- # embeds. The base request costs 1 credit. When enrichment is enabled, the entire
387
- # call costs 5 credits.
413
+ # embeds. The base request costs 1 credit, or 2 credits with browser actions. When
414
+ # enrichment is enabled, the entire call costs 5 credits, including requests that
415
+ # also use actions.
388
416
  #
389
- # @overload web_scrape_images(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
417
+ # @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: {})
390
418
  #
391
419
  # @param url [String] Page URL to inspect. Must include http:// or https://.
392
420
  #
393
- # @param dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc
421
+ # @param actions [Array<ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
422
+ #
423
+ # @param dedupe [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Dedupe] When true, visually duplicate images are removed: every image is loaded and perc
394
424
  #
395
- # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme
425
+ # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil] Optional per-image processing, sent as deep-object query params such as enrichme
396
426
  #
397
427
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
398
428
  #
399
- # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
429
+ # @param max_age_ms [Integer, nil] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1
430
+ #
431
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
400
432
  #
401
433
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
402
434
  #
403
- # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before collec
435
+ # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before collec
404
436
  #
405
437
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
406
438
  #
@@ -432,48 +464,54 @@ module ContextDev
432
464
  #
433
465
  # ### Billing & errors
434
466
  #
435
- # | HTTP status | Billed? | Meaning |
436
- # | ----------- | -------------- | ---------------------------------------------------------------------------------------- |
437
- # | 200 | Yes — 1 credit | Successful scrape, including a zero-length result when includeSelectors matched nothing |
438
- # | 400 | No | Invalid input, skipped PDF, or the page could not be scraped |
439
- # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
440
- # | 404 | No | Target page returned or fingerprinted as not found |
441
- # | 408 | No | Request timed out |
442
- # | 415 | No | Unsupported content type |
443
- # | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
444
- # | 500 | No | Internal error |
467
+ # | HTTP status | Billed? | Meaning |
468
+ # | ----------- | ----------------------------------------- | ---------------------------------------------------------------------------------------- |
469
+ # | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing |
470
+ # | 400 | No | Invalid input, skipped PDF, or the page could not be scraped |
471
+ # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code |
472
+ # | 404 | No | Target page returned or fingerprinted as not found |
473
+ # | 408 | No | Request timed out |
474
+ # | 415 | No | Unsupported content type |
475
+ # | 429 | No | Per-minute rate limit exceeded; honor Retry-After |
476
+ # | 500 | No | Internal error |
445
477
  #
446
- # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
478
+ # @overload web_scrape_md(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: 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: {})
447
479
  #
448
480
  # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
449
481
  #
450
- # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe
482
+ # @param actions [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
483
+ #
484
+ # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r
451
485
  #
452
- # @param exclude_selectors [Array<String>] CSS selectors to remove before conversion to Markdown. Applied after includeSele
486
+ # @param exclude_selectors [Array<String>, nil] CSS selectors to remove before conversion to Markdown. Applied after includeSele
453
487
  #
454
488
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
455
489
  #
456
- # @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown.
490
+ # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeFrames] When true, the contents of iframes are rendered to Markdown.
457
491
  #
458
- # @param include_images [Boolean] Include image references in Markdown output
492
+ # @param include_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeImages] Include image references in Markdown output
459
493
  #
460
- # @param include_links [Boolean] Preserve hyperlinks in Markdown output
494
+ # @param include_links [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeLinks] Preserve hyperlinks in Markdown output
461
495
  #
462
- # @param include_selectors [Array<String>] CSS selectors. When provided, only matching HTML subtrees (and their descendants
496
+ # @param include_selectors [Array<String>, nil] CSS selectors. When provided, only matching HTML subtrees (and their descendants
463
497
  #
464
- # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
498
+ # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y
465
499
  #
466
500
  # @param pdf [ContextDev::Models::WebWebScrapeMdParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image
467
501
  #
468
- # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before conv
502
+ # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before conv
503
+ #
504
+ # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output
469
505
  #
470
- # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
506
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
471
507
  #
472
508
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
473
509
  #
474
- # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars,
510
+ # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly] Extract only the main content of the page, excluding headers, footers, sidebars,
475
511
  #
476
- # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before conver
512
+ # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before conver
513
+ #
514
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
477
515
  #
478
516
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
479
517
  #
@@ -509,7 +547,7 @@ module ContextDev
509
547
  #
510
548
  # Crawl an entire website's sitemap and return all discovered page URLs.
511
549
  #
512
- # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {})
550
+ # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {})
513
551
  #
514
552
  # @param domain [String] Domain to build a sitemap for
515
553
  #
@@ -517,10 +555,16 @@ module ContextDev
517
555
  #
518
556
  # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
519
557
  #
558
+ # @param sitemap_url [String] Optional explicit sitemap URL. When provided, exactly this sitemap is crawled in
559
+ #
560
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
561
+ #
520
562
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
521
563
  #
522
564
  # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
523
565
  #
566
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
567
+ #
524
568
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
525
569
  #
526
570
  # @return [ContextDev::Models::WebWebScrapeSitemapResponse]
@@ -532,7 +576,12 @@ module ContextDev
532
576
  @client.request(
533
577
  method: :get,
534
578
  path: "web/scrape/sitemap",
535
- query: query.transform_keys(max_links: "maxLinks", timeout_ms: "timeoutMS", url_regex: "urlRegex"),
579
+ query: query.transform_keys(
580
+ max_links: "maxLinks",
581
+ sitemap_url: "sitemapUrl",
582
+ timeout_ms: "timeoutMS",
583
+ url_regex: "urlRegex"
584
+ ),
536
585
  model: ContextDev::Models::WebWebScrapeSitemapResponse,
537
586
  options: options
538
587
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "2.4.0"
4
+ VERSION = "2.6.0"
5
5
  end
data/lib/context_dev.rb CHANGED
@@ -56,10 +56,22 @@ require_relative "context_dev/models/ai_extract_product_params"
56
56
  require_relative "context_dev/models/ai_extract_product_response"
57
57
  require_relative "context_dev/models/ai_extract_products_params"
58
58
  require_relative "context_dev/models/ai_extract_products_response"
59
+ require_relative "context_dev/models/batch_cancel_params"
60
+ require_relative "context_dev/models/batch_cancel_response"
61
+ require_relative "context_dev/models/batch_get_results_params"
62
+ require_relative "context_dev/models/batch_get_results_response"
63
+ require_relative "context_dev/models/batch_list_params"
64
+ require_relative "context_dev/models/batch_list_response"
65
+ require_relative "context_dev/models/batch_retrieve_params"
66
+ require_relative "context_dev/models/batch_retrieve_response"
67
+ require_relative "context_dev/models/batch_submit_params"
68
+ require_relative "context_dev/models/batch_submit_response"
59
69
  require_relative "context_dev/models/brand_retrieve_params"
60
70
  require_relative "context_dev/models/brand_retrieve_response"
61
71
  require_relative "context_dev/models/brand_retrieve_simplified_params"
62
72
  require_relative "context_dev/models/brand_retrieve_simplified_response"
73
+ require_relative "context_dev/models/error"
74
+ require_relative "context_dev/models/error_count"
63
75
  require_relative "context_dev/models/industry_retrieve_naics_params"
64
76
  require_relative "context_dev/models/industry_retrieve_naics_response"
65
77
  require_relative "context_dev/models/industry_retrieve_sic_params"
@@ -68,6 +80,10 @@ require_relative "context_dev/models/monitor_create_params"
68
80
  require_relative "context_dev/models/monitor_create_response"
69
81
  require_relative "context_dev/models/monitor_delete_params"
70
82
  require_relative "context_dev/models/monitor_delete_response"
83
+ require_relative "context_dev/models/monitor_get_credit_usage_params"
84
+ require_relative "context_dev/models/monitor_get_credit_usage_response"
85
+ require_relative "context_dev/models/monitor_get_limits_params"
86
+ require_relative "context_dev/models/monitor_get_limits_response"
71
87
  require_relative "context_dev/models/monitor_list_account_changes_params"
72
88
  require_relative "context_dev/models/monitor_list_account_changes_response"
73
89
  require_relative "context_dev/models/monitor_list_account_runs_params"
@@ -115,6 +131,7 @@ require_relative "context_dev/models/web_web_scrape_sitemap_params"
115
131
  require_relative "context_dev/models/web_web_scrape_sitemap_response"
116
132
  require_relative "context_dev/models"
117
133
  require_relative "context_dev/resources/ai"
134
+ require_relative "context_dev/resources/batch"
118
135
  require_relative "context_dev/resources/brand"
119
136
  require_relative "context_dev/resources/industry"
120
137
  require_relative "context_dev/resources/monitors"
@@ -38,6 +38,9 @@ module ContextDev
38
38
  sig { returns(ContextDev::Resources::Monitors) }
39
39
  attr_reader :monitors
40
40
 
41
+ sig { returns(ContextDev::Resources::Batch) }
42
+ attr_reader :batch
43
+
41
44
  # @api private
42
45
  sig { override.returns(T::Hash[String, String]) }
43
46
  private def auth_headers
@@ -27,6 +27,13 @@ module ContextDev
27
27
  sig { params(max_age_ms: Integer).void }
28
28
  attr_writer :max_age_ms
29
29
 
30
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
31
+ sig { returns(T.nilable(T::Array[String])) }
32
+ attr_reader :tags
33
+
34
+ sig { params(tags: T::Array[String]).void }
35
+ attr_writer :tags
36
+
30
37
  # Optional timeout in milliseconds for the request. If the request takes longer
31
38
  # than this value, it will be aborted with a 408 status code. Maximum allowed
32
39
  # value is 300000ms (5 minutes).
@@ -40,6 +47,7 @@ module ContextDev
40
47
  params(
41
48
  url: String,
42
49
  max_age_ms: Integer,
50
+ tags: T::Array[String],
43
51
  timeout_ms: Integer,
44
52
  request_options: ContextDev::RequestOptions::OrHash
45
53
  ).returns(T.attached_class)
@@ -51,6 +59,8 @@ module ContextDev
51
59
  # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when
52
60
  # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
53
61
  max_age_ms: nil,
62
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
63
+ tags: nil,
54
64
  # Optional timeout in milliseconds for the request. If the request takes longer
55
65
  # than this value, it will be aborted with a 408 status code. Maximum allowed
56
66
  # value is 300000ms (5 minutes).
@@ -64,6 +74,7 @@ module ContextDev
64
74
  {
65
75
  url: String,
66
76
  max_age_ms: Integer,
77
+ tags: T::Array[String],
67
78
  timeout_ms: Integer,
68
79
  request_options: ContextDev::RequestOptions
69
80
  }
@@ -92,6 +92,13 @@ module ContextDev
92
92
  sig { params(max_products: Integer).void }
93
93
  attr_writer :max_products
94
94
 
95
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
96
+ sig { returns(T.nilable(T::Array[String])) }
97
+ attr_reader :tags
98
+
99
+ sig { params(tags: T::Array[String]).void }
100
+ attr_writer :tags
101
+
95
102
  # Optional timeout in milliseconds for the request. If the request takes longer
96
103
  # than this value, it will be aborted with a 408 status code. Maximum allowed
97
104
  # value is 300000ms (5 minutes).
@@ -106,6 +113,7 @@ module ContextDev
106
113
  domain: String,
107
114
  max_age_ms: Integer,
108
115
  max_products: Integer,
116
+ tags: T::Array[String],
109
117
  timeout_ms: Integer
110
118
  ).returns(T.attached_class)
111
119
  end
@@ -118,6 +126,8 @@ module ContextDev
118
126
  max_age_ms: nil,
119
127
  # Maximum number of products to extract.
120
128
  max_products: nil,
129
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
130
+ tags: nil,
121
131
  # Optional timeout in milliseconds for the request. If the request takes longer
122
132
  # than this value, it will be aborted with a 408 status code. Maximum allowed
123
133
  # value is 300000ms (5 minutes).
@@ -131,6 +141,7 @@ module ContextDev
131
141
  domain: String,
132
142
  max_age_ms: Integer,
133
143
  max_products: Integer,
144
+ tags: T::Array[String],
134
145
  timeout_ms: Integer
135
146
  }
136
147
  )
@@ -169,6 +180,13 @@ module ContextDev
169
180
  sig { params(max_products: Integer).void }
170
181
  attr_writer :max_products
171
182
 
183
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
184
+ sig { returns(T.nilable(T::Array[String])) }
185
+ attr_reader :tags
186
+
187
+ sig { params(tags: T::Array[String]).void }
188
+ attr_writer :tags
189
+
172
190
  # Optional timeout in milliseconds for the request. If the request takes longer
173
191
  # than this value, it will be aborted with a 408 status code. Maximum allowed
174
192
  # value is 300000ms (5 minutes).
@@ -183,6 +201,7 @@ module ContextDev
183
201
  direct_url: String,
184
202
  max_age_ms: Integer,
185
203
  max_products: Integer,
204
+ tags: T::Array[String],
186
205
  timeout_ms: Integer
187
206
  ).returns(T.attached_class)
188
207
  end
@@ -196,6 +215,8 @@ module ContextDev
196
215
  max_age_ms: nil,
197
216
  # Maximum number of products to extract.
198
217
  max_products: nil,
218
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
219
+ tags: nil,
199
220
  # Optional timeout in milliseconds for the request. If the request takes longer
200
221
  # than this value, it will be aborted with a 408 status code. Maximum allowed
201
222
  # value is 300000ms (5 minutes).
@@ -209,6 +230,7 @@ module ContextDev
209
230
  direct_url: String,
210
231
  max_age_ms: Integer,
211
232
  max_products: Integer,
233
+ tags: T::Array[String],
212
234
  timeout_ms: Integer
213
235
  }
214
236
  )
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module ContextDev
4
+ module Models
5
+ class BatchCancelParams < ContextDev::Internal::Type::BaseModel
6
+ extend ContextDev::Internal::Type::RequestParameters::Converter
7
+ include ContextDev::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(ContextDev::BatchCancelParams, ContextDev::Internal::AnyHash)
12
+ end
13
+
14
+ # ID of the batch to retrieve or cancel.
15
+ sig { returns(String) }
16
+ attr_accessor :batch_id
17
+
18
+ sig do
19
+ params(
20
+ batch_id: String,
21
+ request_options: ContextDev::RequestOptions::OrHash
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(
25
+ # ID of the batch to retrieve or cancel.
26
+ batch_id:,
27
+ request_options: {}
28
+ )
29
+ end
30
+
31
+ sig do
32
+ override.returns(
33
+ { batch_id: String, request_options: ContextDev::RequestOptions }
34
+ )
35
+ end
36
+ def to_hash
37
+ end
38
+ end
39
+ end
40
+ end