context.dev 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +5 -0
- data/lib/context_dev/models/batch_get_results_response.rb +33 -3
- data/lib/context_dev/models/batch_submit_params.rb +44 -316
- data/lib/context_dev/models/brand_retrieve_response.rb +29 -1
- data/lib/context_dev/models/brand_retrieve_simplified_response.rb +30 -1
- data/lib/context_dev/models/brand_search_params.rb +41 -3
- data/lib/context_dev/models/news_search_params.rb +467 -0
- data/lib/context_dev/models/news_search_response.rb +284 -0
- data/lib/context_dev/models/parse_handle_params.rb +15 -144
- data/lib/context_dev/models/person_enrich_response.rb +61 -1
- data/lib/context_dev/models/utility_prefetch_params.rb +19 -16
- data/lib/context_dev/models/utility_prefetch_response.rb +4 -5
- data/lib/context_dev/models/web_screenshot_params.rb +16 -31
- data/lib/context_dev/models/web_web_crawl_md_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +15 -153
- data/lib/context_dev/models/web_web_scrape_html_response.rb +30 -1
- data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -124
- data/lib/context_dev/models/web_web_scrape_md_params.rb +35 -238
- data/lib/context_dev/models/web_web_scrape_md_response.rb +41 -2
- data/lib/context_dev/models.rb +2 -0
- data/lib/context_dev/resources/brand.rb +10 -11
- data/lib/context_dev/resources/news.rb +51 -0
- data/lib/context_dev/resources/parse.rb +5 -5
- data/lib/context_dev/resources/utility.rb +7 -6
- data/lib/context_dev/resources/web.rb +30 -24
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +3 -0
- data/rbi/context_dev/client.rbi +4 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +71 -2
- data/rbi/context_dev/models/batch_submit_params.rbi +58 -592
- data/rbi/context_dev/models/brand_retrieve_response.rbi +80 -3
- data/rbi/context_dev/models/brand_retrieve_simplified_response.rbi +80 -3
- data/rbi/context_dev/models/brand_search_params.rbi +71 -2
- data/rbi/context_dev/models/news_search_params.rbi +1294 -0
- data/rbi/context_dev/models/news_search_response.rbi +489 -0
- data/rbi/context_dev/models/parse_handle_params.rbi +20 -316
- data/rbi/context_dev/models/person_enrich_response.rbi +87 -0
- data/rbi/context_dev/models/utility_prefetch_params.rbi +24 -16
- data/rbi/context_dev/models/utility_prefetch_response.rbi +8 -6
- data/rbi/context_dev/models/web_screenshot_params.rbi +23 -71
- data/rbi/context_dev/models/web_web_crawl_md_response.rbi +67 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +20 -356
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +65 -0
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +16 -287
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +47 -551
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +80 -0
- data/rbi/context_dev/models.rbi +2 -0
- data/rbi/context_dev/resources/brand.rbi +14 -9
- data/rbi/context_dev/resources/news.rbi +46 -0
- data/rbi/context_dev/resources/parse.rbi +5 -21
- data/rbi/context_dev/resources/utility.rbi +8 -6
- data/rbi/context_dev/resources/web.rbi +34 -66
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +21 -0
- data/sig/context_dev/models/batch_submit_params.rbs +54 -144
- data/sig/context_dev/models/brand_retrieve_response.rbs +33 -3
- data/sig/context_dev/models/brand_retrieve_simplified_response.rbs +33 -3
- data/sig/context_dev/models/brand_search_params.rbs +38 -1
- data/sig/context_dev/models/news_search_params.rbs +532 -0
- data/sig/context_dev/models/news_search_response.rbs +206 -0
- data/sig/context_dev/models/parse_handle_params.rbs +25 -90
- data/sig/context_dev/models/person_enrich_response.rbs +31 -0
- data/sig/context_dev/models/utility_prefetch_params.rbs +2 -1
- data/sig/context_dev/models/utility_prefetch_response.rbs +2 -1
- data/sig/context_dev/models/web_screenshot_params.rbs +12 -18
- data/sig/context_dev/models/web_web_crawl_md_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +24 -94
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +21 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +20 -72
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +46 -148
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +28 -0
- data/sig/context_dev/models.rbs +2 -0
- data/sig/context_dev/resources/brand.rbs +3 -0
- data/sig/context_dev/resources/news.rbs +17 -0
- data/sig/context_dev/resources/parse.rbs +5 -5
- data/sig/context_dev/resources/web.rbs +13 -11
- metadata +11 -2
|
@@ -39,27 +39,10 @@ module ContextDev
|
|
|
39
39
|
# perceptually hashed, and only the highest-resolution copy of each duplicate
|
|
40
40
|
# group is kept. Images that cannot be downloaded or hashed are kept. Default:
|
|
41
41
|
# false.
|
|
42
|
-
sig
|
|
43
|
-
returns(
|
|
44
|
-
T.nilable(
|
|
45
|
-
T.any(
|
|
46
|
-
T::Boolean,
|
|
47
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol
|
|
48
|
-
)
|
|
49
|
-
)
|
|
50
|
-
)
|
|
51
|
-
end
|
|
42
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
52
43
|
attr_reader :dedupe
|
|
53
44
|
|
|
54
|
-
sig
|
|
55
|
-
params(
|
|
56
|
-
dedupe:
|
|
57
|
-
T.any(
|
|
58
|
-
T::Boolean,
|
|
59
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol
|
|
60
|
-
)
|
|
61
|
-
).void
|
|
62
|
-
end
|
|
45
|
+
sig { params(dedupe: T::Boolean).void }
|
|
63
46
|
attr_writer :dedupe
|
|
64
47
|
|
|
65
48
|
# Optional per-image processing, sent as deep-object query params such as
|
|
@@ -126,11 +109,7 @@ module ContextDev
|
|
|
126
109
|
)
|
|
127
110
|
]
|
|
128
111
|
),
|
|
129
|
-
dedupe:
|
|
130
|
-
T.any(
|
|
131
|
-
T::Boolean,
|
|
132
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol
|
|
133
|
-
),
|
|
112
|
+
dedupe: T::Boolean,
|
|
134
113
|
enrichment:
|
|
135
114
|
T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash),
|
|
136
115
|
headers: T::Hash[Symbol, String],
|
|
@@ -191,11 +170,7 @@ module ContextDev
|
|
|
191
170
|
)
|
|
192
171
|
]
|
|
193
172
|
),
|
|
194
|
-
dedupe:
|
|
195
|
-
T.any(
|
|
196
|
-
T::Boolean,
|
|
197
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol
|
|
198
|
-
),
|
|
173
|
+
dedupe: T::Boolean,
|
|
199
174
|
enrichment:
|
|
200
175
|
T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment),
|
|
201
176
|
headers: T::Hash[Symbol, String],
|
|
@@ -284,47 +259,6 @@ module ContextDev
|
|
|
284
259
|
end
|
|
285
260
|
end
|
|
286
261
|
|
|
287
|
-
# When true, visually duplicate images are removed: every image is loaded and
|
|
288
|
-
# perceptually hashed, and only the highest-resolution copy of each duplicate
|
|
289
|
-
# group is kept. Images that cannot be downloaded or hashed are kept. Default:
|
|
290
|
-
# false.
|
|
291
|
-
module Dedupe
|
|
292
|
-
extend ContextDev::Internal::Type::Union
|
|
293
|
-
|
|
294
|
-
Variants =
|
|
295
|
-
T.type_alias do
|
|
296
|
-
T.any(
|
|
297
|
-
T::Boolean,
|
|
298
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::TaggedSymbol
|
|
299
|
-
)
|
|
300
|
-
end
|
|
301
|
-
|
|
302
|
-
sig do
|
|
303
|
-
override.returns(
|
|
304
|
-
T::Array[ContextDev::WebWebScrapeImagesParams::Dedupe::Variants]
|
|
305
|
-
)
|
|
306
|
-
end
|
|
307
|
-
def self.variants
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
TaggedSymbol =
|
|
311
|
-
T.type_alias do
|
|
312
|
-
T.all(Symbol, ContextDev::WebWebScrapeImagesParams::Dedupe)
|
|
313
|
-
end
|
|
314
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
315
|
-
|
|
316
|
-
TRUE =
|
|
317
|
-
T.let(
|
|
318
|
-
:true,
|
|
319
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::TaggedSymbol
|
|
320
|
-
)
|
|
321
|
-
FALSE =
|
|
322
|
-
T.let(
|
|
323
|
-
:false,
|
|
324
|
-
ContextDev::WebWebScrapeImagesParams::Dedupe::TaggedSymbol
|
|
325
|
-
)
|
|
326
|
-
end
|
|
327
|
-
|
|
328
262
|
class Enrichment < ContextDev::Internal::Type::BaseModel
|
|
329
263
|
OrHash =
|
|
330
264
|
T.type_alias do
|
|
@@ -335,52 +269,18 @@ module ContextDev
|
|
|
335
269
|
end
|
|
336
270
|
|
|
337
271
|
# Classify each image by visual asset type.
|
|
338
|
-
sig
|
|
339
|
-
returns(
|
|
340
|
-
T.nilable(
|
|
341
|
-
T.any(
|
|
342
|
-
T::Boolean,
|
|
343
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol
|
|
344
|
-
)
|
|
345
|
-
)
|
|
346
|
-
)
|
|
347
|
-
end
|
|
272
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
348
273
|
attr_reader :classification
|
|
349
274
|
|
|
350
|
-
sig
|
|
351
|
-
params(
|
|
352
|
-
classification:
|
|
353
|
-
T.any(
|
|
354
|
-
T::Boolean,
|
|
355
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol
|
|
356
|
-
)
|
|
357
|
-
).void
|
|
358
|
-
end
|
|
275
|
+
sig { params(classification: T::Boolean).void }
|
|
359
276
|
attr_writer :classification
|
|
360
277
|
|
|
361
278
|
# Host materializable images on the Brand.dev CDN and return their URL and MIME
|
|
362
279
|
# type.
|
|
363
|
-
sig
|
|
364
|
-
returns(
|
|
365
|
-
T.nilable(
|
|
366
|
-
T.any(
|
|
367
|
-
T::Boolean,
|
|
368
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol
|
|
369
|
-
)
|
|
370
|
-
)
|
|
371
|
-
)
|
|
372
|
-
end
|
|
280
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
373
281
|
attr_reader :hosted_url
|
|
374
282
|
|
|
375
|
-
sig
|
|
376
|
-
params(
|
|
377
|
-
hosted_url:
|
|
378
|
-
T.any(
|
|
379
|
-
T::Boolean,
|
|
380
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol
|
|
381
|
-
)
|
|
382
|
-
).void
|
|
383
|
-
end
|
|
283
|
+
sig { params(hosted_url: T::Boolean).void }
|
|
384
284
|
attr_writer :hosted_url
|
|
385
285
|
|
|
386
286
|
# Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.
|
|
@@ -391,49 +291,20 @@ module ContextDev
|
|
|
391
291
|
attr_writer :max_time_per_ms
|
|
392
292
|
|
|
393
293
|
# Measure image width and height when possible.
|
|
394
|
-
sig
|
|
395
|
-
returns(
|
|
396
|
-
T.nilable(
|
|
397
|
-
T.any(
|
|
398
|
-
T::Boolean,
|
|
399
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol
|
|
400
|
-
)
|
|
401
|
-
)
|
|
402
|
-
)
|
|
403
|
-
end
|
|
294
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
404
295
|
attr_reader :resolution
|
|
405
296
|
|
|
406
|
-
sig
|
|
407
|
-
params(
|
|
408
|
-
resolution:
|
|
409
|
-
T.any(
|
|
410
|
-
T::Boolean,
|
|
411
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol
|
|
412
|
-
)
|
|
413
|
-
).void
|
|
414
|
-
end
|
|
297
|
+
sig { params(resolution: T::Boolean).void }
|
|
415
298
|
attr_writer :resolution
|
|
416
299
|
|
|
417
300
|
# Optional per-image processing, sent as deep-object query params such as
|
|
418
301
|
# enrichment[resolution]=true.
|
|
419
302
|
sig do
|
|
420
303
|
params(
|
|
421
|
-
classification:
|
|
422
|
-
|
|
423
|
-
T::Boolean,
|
|
424
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol
|
|
425
|
-
),
|
|
426
|
-
hosted_url:
|
|
427
|
-
T.any(
|
|
428
|
-
T::Boolean,
|
|
429
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol
|
|
430
|
-
),
|
|
304
|
+
classification: T::Boolean,
|
|
305
|
+
hosted_url: T::Boolean,
|
|
431
306
|
max_time_per_ms: Integer,
|
|
432
|
-
resolution:
|
|
433
|
-
T.any(
|
|
434
|
-
T::Boolean,
|
|
435
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol
|
|
436
|
-
)
|
|
307
|
+
resolution: T::Boolean
|
|
437
308
|
).returns(T.attached_class)
|
|
438
309
|
end
|
|
439
310
|
def self.new(
|
|
@@ -452,157 +323,15 @@ module ContextDev
|
|
|
452
323
|
sig do
|
|
453
324
|
override.returns(
|
|
454
325
|
{
|
|
455
|
-
classification:
|
|
456
|
-
|
|
457
|
-
T::Boolean,
|
|
458
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol
|
|
459
|
-
),
|
|
460
|
-
hosted_url:
|
|
461
|
-
T.any(
|
|
462
|
-
T::Boolean,
|
|
463
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol
|
|
464
|
-
),
|
|
326
|
+
classification: T::Boolean,
|
|
327
|
+
hosted_url: T::Boolean,
|
|
465
328
|
max_time_per_ms: Integer,
|
|
466
|
-
resolution:
|
|
467
|
-
T.any(
|
|
468
|
-
T::Boolean,
|
|
469
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol
|
|
470
|
-
)
|
|
329
|
+
resolution: T::Boolean
|
|
471
330
|
}
|
|
472
331
|
)
|
|
473
332
|
end
|
|
474
333
|
def to_hash
|
|
475
334
|
end
|
|
476
|
-
|
|
477
|
-
# Classify each image by visual asset type.
|
|
478
|
-
module Classification
|
|
479
|
-
extend ContextDev::Internal::Type::Union
|
|
480
|
-
|
|
481
|
-
Variants =
|
|
482
|
-
T.type_alias do
|
|
483
|
-
T.any(
|
|
484
|
-
T::Boolean,
|
|
485
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::TaggedSymbol
|
|
486
|
-
)
|
|
487
|
-
end
|
|
488
|
-
|
|
489
|
-
sig do
|
|
490
|
-
override.returns(
|
|
491
|
-
T::Array[
|
|
492
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::Variants
|
|
493
|
-
]
|
|
494
|
-
)
|
|
495
|
-
end
|
|
496
|
-
def self.variants
|
|
497
|
-
end
|
|
498
|
-
|
|
499
|
-
TaggedSymbol =
|
|
500
|
-
T.type_alias do
|
|
501
|
-
T.all(
|
|
502
|
-
Symbol,
|
|
503
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification
|
|
504
|
-
)
|
|
505
|
-
end
|
|
506
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
507
|
-
|
|
508
|
-
TRUE =
|
|
509
|
-
T.let(
|
|
510
|
-
:true,
|
|
511
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::TaggedSymbol
|
|
512
|
-
)
|
|
513
|
-
FALSE =
|
|
514
|
-
T.let(
|
|
515
|
-
:false,
|
|
516
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::TaggedSymbol
|
|
517
|
-
)
|
|
518
|
-
end
|
|
519
|
-
|
|
520
|
-
# Host materializable images on the Brand.dev CDN and return their URL and MIME
|
|
521
|
-
# type.
|
|
522
|
-
module HostedURL
|
|
523
|
-
extend ContextDev::Internal::Type::Union
|
|
524
|
-
|
|
525
|
-
Variants =
|
|
526
|
-
T.type_alias do
|
|
527
|
-
T.any(
|
|
528
|
-
T::Boolean,
|
|
529
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::TaggedSymbol
|
|
530
|
-
)
|
|
531
|
-
end
|
|
532
|
-
|
|
533
|
-
sig do
|
|
534
|
-
override.returns(
|
|
535
|
-
T::Array[
|
|
536
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::Variants
|
|
537
|
-
]
|
|
538
|
-
)
|
|
539
|
-
end
|
|
540
|
-
def self.variants
|
|
541
|
-
end
|
|
542
|
-
|
|
543
|
-
TaggedSymbol =
|
|
544
|
-
T.type_alias do
|
|
545
|
-
T.all(
|
|
546
|
-
Symbol,
|
|
547
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL
|
|
548
|
-
)
|
|
549
|
-
end
|
|
550
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
551
|
-
|
|
552
|
-
TRUE =
|
|
553
|
-
T.let(
|
|
554
|
-
:true,
|
|
555
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::TaggedSymbol
|
|
556
|
-
)
|
|
557
|
-
FALSE =
|
|
558
|
-
T.let(
|
|
559
|
-
:false,
|
|
560
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::TaggedSymbol
|
|
561
|
-
)
|
|
562
|
-
end
|
|
563
|
-
|
|
564
|
-
# Measure image width and height when possible.
|
|
565
|
-
module Resolution
|
|
566
|
-
extend ContextDev::Internal::Type::Union
|
|
567
|
-
|
|
568
|
-
Variants =
|
|
569
|
-
T.type_alias do
|
|
570
|
-
T.any(
|
|
571
|
-
T::Boolean,
|
|
572
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::TaggedSymbol
|
|
573
|
-
)
|
|
574
|
-
end
|
|
575
|
-
|
|
576
|
-
sig do
|
|
577
|
-
override.returns(
|
|
578
|
-
T::Array[
|
|
579
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::Variants
|
|
580
|
-
]
|
|
581
|
-
)
|
|
582
|
-
end
|
|
583
|
-
def self.variants
|
|
584
|
-
end
|
|
585
|
-
|
|
586
|
-
TaggedSymbol =
|
|
587
|
-
T.type_alias do
|
|
588
|
-
T.all(
|
|
589
|
-
Symbol,
|
|
590
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution
|
|
591
|
-
)
|
|
592
|
-
end
|
|
593
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
594
|
-
|
|
595
|
-
TRUE =
|
|
596
|
-
T.let(
|
|
597
|
-
:true,
|
|
598
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::TaggedSymbol
|
|
599
|
-
)
|
|
600
|
-
FALSE =
|
|
601
|
-
T.let(
|
|
602
|
-
:false,
|
|
603
|
-
ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::TaggedSymbol
|
|
604
|
-
)
|
|
605
|
-
end
|
|
606
335
|
end
|
|
607
336
|
end
|
|
608
337
|
end
|