context.dev 2.11.0 → 2.13.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +4 -4
  4. data/lib/context_dev/models/ai_extract_product_response.rb +102 -2
  5. data/lib/context_dev/models/ai_extract_products_response.rb +102 -2
  6. data/lib/context_dev/models/batch_get_results_response.rb +56 -1
  7. data/lib/context_dev/models/batch_submit_response.rb +54 -1
  8. data/lib/context_dev/models/brand_retrieve_response.rb +58 -3
  9. data/lib/context_dev/models/brand_retrieve_simplified_response.rb +55 -1
  10. data/lib/context_dev/models/news_search_params.rb +1 -0
  11. data/lib/context_dev/models/web_extract_fonts_response.rb +54 -1
  12. data/lib/context_dev/models/web_extract_params.rb +169 -6
  13. data/lib/context_dev/models/web_extract_response.rb +139 -2
  14. data/lib/context_dev/models/web_extract_styleguide_response.rb +55 -1
  15. data/lib/context_dev/models/web_screenshot_response.rb +54 -1
  16. data/lib/context_dev/models/web_search_response.rb +54 -1
  17. data/lib/context_dev/models/web_web_crawl_md_params.rb +7 -5
  18. data/lib/context_dev/models/web_web_crawl_md_response.rb +54 -1
  19. data/lib/context_dev/models/web_web_scrape_html_params.rb +99 -3
  20. data/lib/context_dev/models/web_web_scrape_html_response.rb +54 -1
  21. data/lib/context_dev/models/web_web_scrape_images_params.rb +99 -3
  22. data/lib/context_dev/models/web_web_scrape_images_response.rb +139 -1
  23. data/lib/context_dev/models/web_web_scrape_md_params.rb +99 -3
  24. data/lib/context_dev/models/web_web_scrape_md_response.rb +54 -1
  25. data/lib/context_dev/resources/web.rb +9 -7
  26. data/lib/context_dev/version.rb +1 -1
  27. data/rbi/context_dev/models/ai_extract_product_response.rbi +218 -0
  28. data/rbi/context_dev/models/ai_extract_products_response.rbi +218 -0
  29. data/rbi/context_dev/models/batch_get_results_response.rbi +121 -0
  30. data/rbi/context_dev/models/batch_submit_response.rbi +117 -0
  31. data/rbi/context_dev/models/brand_retrieve_response.rbi +123 -2
  32. data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +121 -0
  33. data/rbi/context_dev/models/news_search_params.rbi +5 -0
  34. data/rbi/context_dev/models/web_extract_fonts_response.rbi +119 -0
  35. data/rbi/context_dev/models/web_extract_params.rbi +353 -8
  36. data/rbi/context_dev/models/web_extract_response.rbi +289 -3
  37. data/rbi/context_dev/models/web_extract_styleguide_response.rbi +119 -0
  38. data/rbi/context_dev/models/web_screenshot_response.rbi +117 -0
  39. data/rbi/context_dev/models/web_search_response.rbi +117 -0
  40. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +10 -6
  41. data/rbi/context_dev/models/web_web_crawl_md_response.rbi +117 -0
  42. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +218 -4
  43. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +119 -0
  44. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +218 -4
  45. data/rbi/context_dev/models/web_web_scrape_images_response.rbi +288 -0
  46. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +218 -4
  47. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +117 -0
  48. data/rbi/context_dev/resources/web.rbi +31 -10
  49. data/sig/context_dev/models/ai_extract_product_response.rbs +79 -0
  50. data/sig/context_dev/models/ai_extract_products_response.rbs +79 -0
  51. data/sig/context_dev/models/batch_get_results_response.rbs +39 -0
  52. data/sig/context_dev/models/batch_submit_response.rbs +39 -0
  53. data/sig/context_dev/models/brand_retrieve_response.rbs +39 -0
  54. data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +39 -0
  55. data/sig/context_dev/models/news_search_params.rbs +2 -0
  56. data/sig/context_dev/models/web_extract_fonts_response.rbs +39 -0
  57. data/sig/context_dev/models/web_extract_params.rbs +117 -0
  58. data/sig/context_dev/models/web_extract_response.rbs +120 -3
  59. data/sig/context_dev/models/web_extract_styleguide_response.rbs +39 -0
  60. data/sig/context_dev/models/web_screenshot_response.rbs +39 -0
  61. data/sig/context_dev/models/web_search_response.rbs +39 -0
  62. data/sig/context_dev/models/web_web_crawl_md_response.rbs +39 -0
  63. data/sig/context_dev/models/web_web_scrape_html_params.rbs +74 -0
  64. data/sig/context_dev/models/web_web_scrape_html_response.rbs +39 -0
  65. data/sig/context_dev/models/web_web_scrape_images_params.rbs +74 -0
  66. data/sig/context_dev/models/web_web_scrape_images_response.rbs +117 -0
  67. data/sig/context_dev/models/web_web_scrape_md_params.rbs +74 -0
  68. data/sig/context_dev/models/web_web_scrape_md_response.rbs +39 -0
  69. data/sig/context_dev/resources/web.rbs +1 -0
  70. metadata +2 -2
@@ -18,7 +18,7 @@ module ContextDev
18
18
  # content is captured. Requires a paid plan. Send a JSON array in the query
19
19
  # parameter. Maximum: 5 actions.
20
20
  #
21
- # @return [Array<ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform>, nil]
21
+ # @return [Array<ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll>, nil]
22
22
  optional :actions,
23
23
  -> {
24
24
  ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeImagesParams::Action]
@@ -85,7 +85,7 @@ module ContextDev
85
85
  #
86
86
  # @param url [String] Page URL to inspect. Must include http:// or https://.
87
87
  #
88
- # @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
88
+ # @param actions [Array<ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll>, nil] Optional browser actions executed in array order after the page loads and before
89
89
  #
90
90
  # @param dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc
91
91
  #
@@ -116,6 +116,9 @@ module ContextDev
116
116
  # Resolve and perform one natural-language browser action.
117
117
  variant :perform, -> { ContextDev::WebWebScrapeImagesParams::Action::Perform }
118
118
 
119
+ # Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
120
+ variant :scroll, -> { ContextDev::WebWebScrapeImagesParams::Action::Scroll }
121
+
119
122
  class Wait < ContextDev::Internal::Type::BaseModel
120
123
  # @!attribute do_
121
124
  #
@@ -152,8 +155,101 @@ module ContextDev
152
155
  # @param do_ [Symbol, :perform]
153
156
  end
154
157
 
158
+ class Scroll < ContextDev::Internal::Type::BaseModel
159
+ # @!attribute do_
160
+ #
161
+ # @return [Symbol, :scroll]
162
+ required :do_, const: :scroll, api_name: :do
163
+
164
+ # @!attribute amount
165
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
166
+ # Defaults to viewport.
167
+ #
168
+ # @return [Integer, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount, nil]
169
+ optional :amount, union: -> { ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount }
170
+
171
+ # @!attribute container
172
+ # CSS selector for the first matching scroll container. Defaults to the page.
173
+ #
174
+ # @return [String, nil]
175
+ optional :container, String
176
+
177
+ # @!attribute direction
178
+ # Direction to scroll. Defaults to down.
179
+ #
180
+ # @return [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Direction, nil]
181
+ optional :direction, enum: -> { ContextDev::WebWebScrapeImagesParams::Action::Scroll::Direction }
182
+
183
+ # @!attribute max_scrolls
184
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
185
+ # changing. Defaults to 1.
186
+ #
187
+ # @return [Integer, nil]
188
+ optional :max_scrolls, Integer, api_name: :maxScrolls
189
+
190
+ # @!method initialize(amount: nil, container: nil, direction: nil, max_scrolls: nil, do_: :scroll)
191
+ # Some parameter documentations has been truncated, see
192
+ # {ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll} for more details.
193
+ #
194
+ # Scroll the page or a selected scrollable container, waiting adaptively for
195
+ # content and dimensions to settle after each iteration.
196
+ #
197
+ # @param amount [Integer, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount] Pixels per scroll, one visible viewport, or the current scroll boundary. Default
198
+ #
199
+ # @param container [String] CSS selector for the first matching scroll container. Defaults to the page.
200
+ #
201
+ # @param direction [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Direction] Direction to scroll. Defaults to down.
202
+ #
203
+ # @param max_scrolls [Integer] Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
204
+ #
205
+ # @param do_ [Symbol, :scroll]
206
+
207
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
208
+ # Defaults to viewport.
209
+ #
210
+ # @see ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll#amount
211
+ module Amount
212
+ extend ContextDev::Internal::Type::Union
213
+
214
+ variant Integer
215
+
216
+ variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount::VIEWPORT }
217
+
218
+ variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll::Amount::MAX }
219
+
220
+ # @!method self.variants
221
+ # @return [Array(Integer, Symbol)]
222
+
223
+ define_sorbet_constant!(:Variants) do
224
+ T.type_alias { T.any(Integer, ContextDev::WebWebScrapeImagesParams::Action::Scroll::Amount::TaggedSymbol) }
225
+ end
226
+
227
+ # @!group
228
+
229
+ VIEWPORT = :viewport
230
+ MAX = :max
231
+
232
+ # @!endgroup
233
+ end
234
+
235
+ # Direction to scroll. Defaults to down.
236
+ #
237
+ # @see ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll#direction
238
+ module Direction
239
+ extend ContextDev::Internal::Type::Enum
240
+
241
+ UP = :up
242
+ DOWN = :down
243
+ LEFT = :left
244
+ RIGHT = :right
245
+
246
+ # @!method self.values
247
+ # @return [Array<Symbol>]
248
+ end
249
+ end
250
+
155
251
  # @!method self.variants
156
- # @return [Array(ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform)]
252
+ # @return [Array(ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll)]
157
253
  end
158
254
 
159
255
  class Enrichment < ContextDev::Internal::Type::BaseModel
@@ -4,6 +4,14 @@ module ContextDev
4
4
  module Models
5
5
  # @see ContextDev::Resources::Web#web_scrape_images
6
6
  class WebWebScrapeImagesResponse < ContextDev::Internal::Type::BaseModel
7
+ # @!attribute cache_metadata
8
+ # Cache outcome for this response. Composite responses are hits only when every
9
+ # cache-controlled fetch contributing to the output was a hit; age_ms is the
10
+ # oldest contributing hit.
11
+ #
12
+ # @return [ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata]
13
+ required :cache_metadata, -> { ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata }
14
+
7
15
  # @!attribute images
8
16
  # Images found on the page.
9
17
  #
@@ -23,6 +31,14 @@ module ContextDev
23
31
  # @return [String]
24
32
  required :url, String
25
33
 
34
+ # @!attribute actions_applied
35
+ # One verified outcome per requested browser action, in request order.
36
+ #
37
+ # @return [Array<ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied>, nil]
38
+ optional :actions_applied,
39
+ -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied] },
40
+ api_name: :actionsApplied
41
+
26
42
  # @!attribute key_metadata
27
43
  # Metadata about the API key used for the request. Included in every response
28
44
  # whenever a valid API key is provided, even when the response status is not 200.
@@ -30,18 +46,66 @@ module ContextDev
30
46
  # @return [ContextDev::Models::WebWebScrapeImagesResponse::KeyMetadata, nil]
31
47
  optional :key_metadata, -> { ContextDev::Models::WebWebScrapeImagesResponse::KeyMetadata }
32
48
 
33
- # @!method initialize(images:, success:, url:, key_metadata: nil)
49
+ # @!method initialize(cache_metadata:, images:, success:, url:, actions_applied: nil, key_metadata: nil)
34
50
  # Some parameter documentations has been truncated, see
35
51
  # {ContextDev::Models::WebWebScrapeImagesResponse} for more details.
36
52
  #
53
+ # @param cache_metadata [ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
54
+ #
37
55
  # @param images [Array<ContextDev::Models::WebWebScrapeImagesResponse::Image>] Images found on the page.
38
56
  #
39
57
  # @param success [Boolean, ContextDev::Models::WebWebScrapeImagesResponse::Success] Always true on success.
40
58
  #
41
59
  # @param url [String] Page URL that was scraped.
42
60
  #
61
+ # @param actions_applied [Array<ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied>] One verified outcome per requested browser action, in request order.
62
+ #
43
63
  # @param key_metadata [ContextDev::Models::WebWebScrapeImagesResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
44
64
 
65
+ # @see ContextDev::Models::WebWebScrapeImagesResponse#cache_metadata
66
+ class CacheMetadata < ContextDev::Internal::Type::BaseModel
67
+ # @!attribute age_ms
68
+ # Age of the cached data in milliseconds. Zero for miss and zdr responses.
69
+ #
70
+ # @return [Integer]
71
+ required :age_ms, Integer
72
+
73
+ # @!attribute status
74
+ # Whether the response was served from cache, required fresh work, or honored
75
+ # zero-data-retention cache bypass.
76
+ #
77
+ # @return [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status]
78
+ required :status, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status }
79
+
80
+ # @!method initialize(age_ms:, status:)
81
+ # Some parameter documentations has been truncated, see
82
+ # {ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata} for more
83
+ # details.
84
+ #
85
+ # Cache outcome for this response. Composite responses are hits only when every
86
+ # cache-controlled fetch contributing to the output was a hit; age_ms is the
87
+ # oldest contributing hit.
88
+ #
89
+ # @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
90
+ #
91
+ # @param status [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero
92
+
93
+ # Whether the response was served from cache, required fresh work, or honored
94
+ # zero-data-retention cache bypass.
95
+ #
96
+ # @see ContextDev::Models::WebWebScrapeImagesResponse::CacheMetadata#status
97
+ module Status
98
+ extend ContextDev::Internal::Type::Enum
99
+
100
+ HIT = :hit
101
+ MISS = :miss
102
+ ZDR = :zdr
103
+
104
+ # @!method self.values
105
+ # @return [Array<Symbol>]
106
+ end
107
+ end
108
+
45
109
  class Image < ContextDev::Internal::Type::BaseModel
46
110
  # @!attribute alt
47
111
  # Image alt text, or null when unavailable.
@@ -196,6 +260,80 @@ module ContextDev
196
260
  # @return [Array<Boolean>]
197
261
  end
198
262
 
263
+ class ActionsApplied < ContextDev::Internal::Type::BaseModel
264
+ # @!attribute instruction
265
+ #
266
+ # @return [String]
267
+ required :instruction, String
268
+
269
+ # @!attribute status
270
+ # Applied means the requested page state was visibly verified. Failed means it was
271
+ # not verified. Skipped means it was not attempted.
272
+ #
273
+ # @return [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status]
274
+ required :status, enum: -> { ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status }
275
+
276
+ # @!attribute completion_evidence
277
+ # Visible page evidence used to verify an applied action.
278
+ #
279
+ # @return [String, nil]
280
+ optional :completion_evidence, String, api_name: :completionEvidence
281
+
282
+ # @!attribute duration_ms
283
+ #
284
+ # @return [Float, nil]
285
+ optional :duration_ms, Float, api_name: :durationMs
286
+
287
+ # @!attribute error
288
+ #
289
+ # @return [String, nil]
290
+ optional :error, String
291
+
292
+ # @!attribute method_
293
+ #
294
+ # @return [String, nil]
295
+ optional :method_, String, api_name: :method
296
+
297
+ # @!attribute target_description
298
+ #
299
+ # @return [String, nil]
300
+ optional :target_description, String, api_name: :targetDescription
301
+
302
+ # @!method initialize(instruction:, status:, completion_evidence: nil, duration_ms: nil, error: nil, method_: nil, target_description: nil)
303
+ # Some parameter documentations has been truncated, see
304
+ # {ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied} for more
305
+ # details.
306
+ #
307
+ # @param instruction [String]
308
+ #
309
+ # @param status [Symbol, ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied::Status] Applied means the requested page state was visibly verified. Failed means it was
310
+ #
311
+ # @param completion_evidence [String] Visible page evidence used to verify an applied action.
312
+ #
313
+ # @param duration_ms [Float]
314
+ #
315
+ # @param error [String]
316
+ #
317
+ # @param method_ [String]
318
+ #
319
+ # @param target_description [String]
320
+
321
+ # Applied means the requested page state was visibly verified. Failed means it was
322
+ # not verified. Skipped means it was not attempted.
323
+ #
324
+ # @see ContextDev::Models::WebWebScrapeImagesResponse::ActionsApplied#status
325
+ module Status
326
+ extend ContextDev::Internal::Type::Enum
327
+
328
+ APPLIED = :applied
329
+ FAILED = :failed
330
+ SKIPPED = :skipped
331
+
332
+ # @!method self.values
333
+ # @return [Array<Symbol>]
334
+ end
335
+ end
336
+
199
337
  # @see ContextDev::Models::WebWebScrapeImagesResponse#key_metadata
200
338
  class KeyMetadata < ContextDev::Internal::Type::BaseModel
201
339
  # @!attribute credits_consumed
@@ -19,7 +19,7 @@ module ContextDev
19
19
  # content is captured. Requires a paid plan. Send a JSON array in the query
20
20
  # parameter. Maximum: 5 actions.
21
21
  #
22
- # @return [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform>, nil]
22
+ # @return [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll>, nil]
23
23
  optional :actions,
24
24
  -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeMdParams::Action] },
25
25
  nil?: true
@@ -155,7 +155,7 @@ module ContextDev
155
155
  #
156
156
  # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
157
157
  #
158
- # @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
158
+ # @param actions [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll>, nil] Optional browser actions executed in array order after the page loads and before
159
159
  #
160
160
  # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
161
161
  #
@@ -206,6 +206,9 @@ module ContextDev
206
206
  # Resolve and perform one natural-language browser action.
207
207
  variant :perform, -> { ContextDev::WebWebScrapeMdParams::Action::Perform }
208
208
 
209
+ # Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.
210
+ variant :scroll, -> { ContextDev::WebWebScrapeMdParams::Action::Scroll }
211
+
209
212
  class Wait < ContextDev::Internal::Type::BaseModel
210
213
  # @!attribute do_
211
214
  #
@@ -242,8 +245,101 @@ module ContextDev
242
245
  # @param do_ [Symbol, :perform]
243
246
  end
244
247
 
248
+ class Scroll < ContextDev::Internal::Type::BaseModel
249
+ # @!attribute do_
250
+ #
251
+ # @return [Symbol, :scroll]
252
+ required :do_, const: :scroll, api_name: :do
253
+
254
+ # @!attribute amount
255
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
256
+ # Defaults to viewport.
257
+ #
258
+ # @return [Integer, Symbol, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll::Amount, nil]
259
+ optional :amount, union: -> { ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount }
260
+
261
+ # @!attribute container
262
+ # CSS selector for the first matching scroll container. Defaults to the page.
263
+ #
264
+ # @return [String, nil]
265
+ optional :container, String
266
+
267
+ # @!attribute direction
268
+ # Direction to scroll. Defaults to down.
269
+ #
270
+ # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll::Direction, nil]
271
+ optional :direction, enum: -> { ContextDev::WebWebScrapeMdParams::Action::Scroll::Direction }
272
+
273
+ # @!attribute max_scrolls
274
+ # Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
275
+ # changing. Defaults to 1.
276
+ #
277
+ # @return [Integer, nil]
278
+ optional :max_scrolls, Integer, api_name: :maxScrolls
279
+
280
+ # @!method initialize(amount: nil, container: nil, direction: nil, max_scrolls: nil, do_: :scroll)
281
+ # Some parameter documentations has been truncated, see
282
+ # {ContextDev::Models::WebWebScrapeMdParams::Action::Scroll} for more details.
283
+ #
284
+ # Scroll the page or a selected scrollable container, waiting adaptively for
285
+ # content and dimensions to settle after each iteration.
286
+ #
287
+ # @param amount [Integer, Symbol, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll::Amount] Pixels per scroll, one visible viewport, or the current scroll boundary. Default
288
+ #
289
+ # @param container [String] CSS selector for the first matching scroll container. Defaults to the page.
290
+ #
291
+ # @param direction [Symbol, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll::Direction] Direction to scroll. Defaults to down.
292
+ #
293
+ # @param max_scrolls [Integer] Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
294
+ #
295
+ # @param do_ [Symbol, :scroll]
296
+
297
+ # Pixels per scroll, one visible viewport, or the current scroll boundary.
298
+ # Defaults to viewport.
299
+ #
300
+ # @see ContextDev::Models::WebWebScrapeMdParams::Action::Scroll#amount
301
+ module Amount
302
+ extend ContextDev::Internal::Type::Union
303
+
304
+ variant Integer
305
+
306
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Action::Scroll::Amount::VIEWPORT }
307
+
308
+ variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Action::Scroll::Amount::MAX }
309
+
310
+ # @!method self.variants
311
+ # @return [Array(Integer, Symbol)]
312
+
313
+ define_sorbet_constant!(:Variants) do
314
+ T.type_alias { T.any(Integer, ContextDev::WebWebScrapeMdParams::Action::Scroll::Amount::TaggedSymbol) }
315
+ end
316
+
317
+ # @!group
318
+
319
+ VIEWPORT = :viewport
320
+ MAX = :max
321
+
322
+ # @!endgroup
323
+ end
324
+
325
+ # Direction to scroll. Defaults to down.
326
+ #
327
+ # @see ContextDev::Models::WebWebScrapeMdParams::Action::Scroll#direction
328
+ module Direction
329
+ extend ContextDev::Internal::Type::Enum
330
+
331
+ UP = :up
332
+ DOWN = :down
333
+ LEFT = :left
334
+ RIGHT = :right
335
+
336
+ # @!method self.values
337
+ # @return [Array<Symbol>]
338
+ end
339
+ end
340
+
245
341
  # @!method self.variants
246
- # @return [Array(ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform)]
342
+ # @return [Array(ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll)]
247
343
  end
248
344
 
249
345
  # Fetch the target page through a residential proxy in this country (ISO 3166-1
@@ -4,6 +4,14 @@ module ContextDev
4
4
  module Models
5
5
  # @see ContextDev::Resources::Web#web_scrape_md
6
6
  class WebWebScrapeMdResponse < ContextDev::Internal::Type::BaseModel
7
+ # @!attribute cache_metadata
8
+ # Cache outcome for this response. Composite responses are hits only when every
9
+ # cache-controlled fetch contributing to the output was a hit; age_ms is the
10
+ # oldest contributing hit.
11
+ #
12
+ # @return [ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata]
13
+ required :cache_metadata, -> { ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata }
14
+
7
15
  # @!attribute content_length
8
16
  # UTF-8 byte length of the returned Markdown. Use 0 to identify an empty result
9
17
  # and compare small values against your workload's minimum useful-content
@@ -66,10 +74,12 @@ module ContextDev
66
74
  # @return [ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata, nil]
67
75
  optional :key_metadata, -> { ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata }
68
76
 
69
- # @!method initialize(content_length:, markdown:, metadata:, success:, url:, actions_applied: nil, actions_html_stale: nil, html: nil, key_metadata: nil)
77
+ # @!method initialize(cache_metadata:, content_length:, markdown:, metadata:, success:, url:, actions_applied: nil, actions_html_stale: nil, html: nil, key_metadata: nil)
70
78
  # Some parameter documentations has been truncated, see
71
79
  # {ContextDev::Models::WebWebScrapeMdResponse} for more details.
72
80
  #
81
+ # @param cache_metadata [ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata] Cache outcome for this response. Composite responses are hits only when every ca
82
+ #
73
83
  # @param content_length [Integer] UTF-8 byte length of the returned Markdown. Use 0 to identify an empty result an
74
84
  #
75
85
  # @param markdown [String] Page content converted to GitHub Flavored Markdown
@@ -88,6 +98,49 @@ module ContextDev
88
98
  #
89
99
  # @param key_metadata [ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
90
100
 
101
+ # @see ContextDev::Models::WebWebScrapeMdResponse#cache_metadata
102
+ class CacheMetadata < ContextDev::Internal::Type::BaseModel
103
+ # @!attribute age_ms
104
+ # Age of the cached data in milliseconds. Zero for miss and zdr responses.
105
+ #
106
+ # @return [Integer]
107
+ required :age_ms, Integer
108
+
109
+ # @!attribute status
110
+ # Whether the response was served from cache, required fresh work, or honored
111
+ # zero-data-retention cache bypass.
112
+ #
113
+ # @return [Symbol, ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status]
114
+ required :status, enum: -> { ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status }
115
+
116
+ # @!method initialize(age_ms:, status:)
117
+ # Some parameter documentations has been truncated, see
118
+ # {ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata} for more details.
119
+ #
120
+ # Cache outcome for this response. Composite responses are hits only when every
121
+ # cache-controlled fetch contributing to the output was a hit; age_ms is the
122
+ # oldest contributing hit.
123
+ #
124
+ # @param age_ms [Integer] Age of the cached data in milliseconds. Zero for miss and zdr responses.
125
+ #
126
+ # @param status [Symbol, ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata::Status] Whether the response was served from cache, required fresh work, or honored zero
127
+
128
+ # Whether the response was served from cache, required fresh work, or honored
129
+ # zero-data-retention cache bypass.
130
+ #
131
+ # @see ContextDev::Models::WebWebScrapeMdResponse::CacheMetadata#status
132
+ module Status
133
+ extend ContextDev::Internal::Type::Enum
134
+
135
+ HIT = :hit
136
+ MISS = :miss
137
+ ZDR = :zdr
138
+
139
+ # @!method self.values
140
+ # @return [Array<Symbol>]
141
+ end
142
+ end
143
+
91
144
  # @see ContextDev::Models::WebWebScrapeMdResponse#metadata
92
145
  class Metadata < ContextDev::Internal::Type::BaseModel
93
146
  # @!attribute final_url
@@ -9,12 +9,14 @@ 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, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
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: {})
13
13
  #
14
- # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. TypeScript Zod users can pass a JSON S
14
+ # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. Image fields such as `image_urls` or `
15
15
  #
16
16
  # @param url [String] The starting website URL to crawl and extract from. Must include http:// or http
17
17
  #
18
+ # @param actions [Array<ContextDev::Models::WebExtractParams::Action::Wait, ContextDev::Models::WebExtractParams::Action::Perform, ContextDev::Models::WebExtractParams::Action::Scroll>] Optional browser actions executed in order on the requested page after it loads,
19
+ #
18
20
  # @param fact_check [Boolean] When true, every returned value must be grounded in facts stated on the page; fi
19
21
  #
20
22
  # @param follow_subdomains [Boolean] When true, follow links on subdomains of the starting URL's domain.
@@ -320,11 +322,11 @@ module ContextDev
320
322
  #
321
323
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
322
324
  #
323
- # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped.
325
+ # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. An
324
326
  #
325
327
  # @param use_main_content_only [Boolean] Extract only the main content, stripping headers, footers, sidebars, and navigat
326
328
  #
327
- # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw
329
+ # @param wait_for_ms [Integer] Browser wait time in milliseconds after initial page load for each crawled page.
328
330
  #
329
331
  # @param zdr [Symbol, ContextDev::Models::WebWebCrawlMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
330
332
  #
@@ -354,7 +356,7 @@ module ContextDev
354
356
  #
355
357
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
356
358
  #
357
- # @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
359
+ # @param actions [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform, ContextDev::Models::WebWebScrapeHTMLParams::Action::Scroll>, nil] Optional browser actions executed in array order after the page loads and before
358
360
  #
359
361
  # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
360
362
  #
@@ -421,7 +423,7 @@ module ContextDev
421
423
  #
422
424
  # @param url [String] Page URL to inspect. Must include http:// or https://.
423
425
  #
424
- # @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
426
+ # @param actions [Array<ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform, ContextDev::Models::WebWebScrapeImagesParams::Action::Scroll>, nil] Optional browser actions executed in array order after the page loads and before
425
427
  #
426
428
  # @param dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc
427
429
  #
@@ -495,7 +497,7 @@ module ContextDev
495
497
  #
496
498
  # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
497
499
  #
498
- # @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
500
+ # @param actions [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform, ContextDev::Models::WebWebScrapeMdParams::Action::Scroll>, nil] Optional browser actions executed in array order after the page loads and before
499
501
  #
500
502
  # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
501
503
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "2.11.0"
4
+ VERSION = "2.13.0"
5
5
  end