context.dev 2.19.0 → 2.20.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 +202 -0
- data/README.md +1 -1
- data/lib/context_dev/models/web_scrape_params.rb +133 -4
- data/lib/context_dev/models/web_scrape_response.rb +321 -6
- data/lib/context_dev/resources/web.rb +20 -8
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/web_scrape_params.rbi +224 -3
- data/rbi/context_dev/models/web_scrape_response.rbi +564 -6
- data/rbi/context_dev/resources/web.rbi +24 -7
- data/sig/context_dev/models/web_scrape_params.rbs +91 -0
- data/sig/context_dev/models/web_scrape_response.rbs +230 -0
- data/sig/context_dev/resources/web.rbs +3 -0
- metadata +2 -2
|
@@ -35,6 +35,19 @@ module ContextDev
|
|
|
35
35
|
end
|
|
36
36
|
attr_writer :cache_metadata
|
|
37
37
|
|
|
38
|
+
# Plain-text passages relevant to highlightsParams.query, in page order, each
|
|
39
|
+
# prefixed with its section heading in square brackets. Empty when the page has no
|
|
40
|
+
# text.
|
|
41
|
+
sig { returns(ContextDev::Models::WebScrapeResponse::Highlights) }
|
|
42
|
+
attr_reader :highlights
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
highlights: ContextDev::Models::WebScrapeResponse::Highlights::OrHash
|
|
47
|
+
).void
|
|
48
|
+
end
|
|
49
|
+
attr_writer :highlights
|
|
50
|
+
|
|
38
51
|
# Rendered HTML after content filters.
|
|
39
52
|
sig { returns(ContextDev::Models::WebScrapeResponse::HTML) }
|
|
40
53
|
attr_reader :html
|
|
@@ -55,6 +68,18 @@ module ContextDev
|
|
|
55
68
|
end
|
|
56
69
|
attr_writer :images
|
|
57
70
|
|
|
71
|
+
# Page data extracted into jsonParams.schema, after shared content filters. Values
|
|
72
|
+
# are grounded in the page; optional fields the page does not state are omitted,
|
|
73
|
+
# or null when their type allows null. An empty object when the filters leave no
|
|
74
|
+
# text.
|
|
75
|
+
sig { returns(ContextDev::Models::WebScrapeResponse::Json) }
|
|
76
|
+
attr_reader :json
|
|
77
|
+
|
|
78
|
+
sig do
|
|
79
|
+
params(json: ContextDev::Models::WebScrapeResponse::Json::OrHash).void
|
|
80
|
+
end
|
|
81
|
+
attr_writer :json
|
|
82
|
+
|
|
58
83
|
# Markdown after content filters.
|
|
59
84
|
sig { returns(ContextDev::Models::WebScrapeResponse::Markdown) }
|
|
60
85
|
attr_reader :markdown
|
|
@@ -88,6 +113,17 @@ module ContextDev
|
|
|
88
113
|
end
|
|
89
114
|
attr_writer :parsed
|
|
90
115
|
|
|
116
|
+
# Product detail page classification and the extracted product.
|
|
117
|
+
sig { returns(ContextDev::Models::WebScrapeResponse::Product) }
|
|
118
|
+
attr_reader :product
|
|
119
|
+
|
|
120
|
+
sig do
|
|
121
|
+
params(
|
|
122
|
+
product: ContextDev::Models::WebScrapeResponse::Product::OrHash
|
|
123
|
+
).void
|
|
124
|
+
end
|
|
125
|
+
attr_writer :product
|
|
126
|
+
|
|
91
127
|
# Unique id of this API call, also sent in the X-Request-Id response header. Quote
|
|
92
128
|
# it when contacting support about a failed request.
|
|
93
129
|
sig { returns(String) }
|
|
@@ -108,8 +144,10 @@ module ContextDev
|
|
|
108
144
|
sig { returns(String) }
|
|
109
145
|
attr_accessor :url
|
|
110
146
|
|
|
111
|
-
# Present when return-partial captures a page that is still loading
|
|
112
|
-
# images before image processing finishes
|
|
147
|
+
# Present when return-partial captures a page that is still loading, returns
|
|
148
|
+
# images before image processing finishes, or cuts product AI extraction short.
|
|
149
|
+
# Also present if the optional product AI fallback fails. Partial responses are
|
|
150
|
+
# not cached.
|
|
113
151
|
sig do
|
|
114
152
|
returns(
|
|
115
153
|
T.nilable(
|
|
@@ -146,11 +184,14 @@ module ContextDev
|
|
|
146
184
|
bytes: ContextDev::Models::WebScrapeResponse::Bytes::OrHash,
|
|
147
185
|
cache_metadata:
|
|
148
186
|
ContextDev::Models::WebScrapeResponse::CacheMetadata::OrHash,
|
|
187
|
+
highlights: ContextDev::Models::WebScrapeResponse::Highlights::OrHash,
|
|
149
188
|
html: ContextDev::Models::WebScrapeResponse::HTML::OrHash,
|
|
150
189
|
images: ContextDev::Models::WebScrapeResponse::Images::OrHash,
|
|
190
|
+
json: ContextDev::Models::WebScrapeResponse::Json::OrHash,
|
|
151
191
|
markdown: ContextDev::Models::WebScrapeResponse::Markdown::OrHash,
|
|
152
192
|
metadata: ContextDev::Models::WebScrapeResponse::Metadata::OrHash,
|
|
153
193
|
parsed: ContextDev::Models::WebScrapeResponse::Parsed::OrHash,
|
|
194
|
+
product: ContextDev::Models::WebScrapeResponse::Product::OrHash,
|
|
154
195
|
request_id: String,
|
|
155
196
|
screenshot: ContextDev::Models::WebScrapeResponse::Screenshot::OrHash,
|
|
156
197
|
url: String,
|
|
@@ -168,16 +209,27 @@ module ContextDev
|
|
|
168
209
|
# cache-controlled fetch contributing to the output was a hit; age_ms is the
|
|
169
210
|
# oldest contributing hit.
|
|
170
211
|
cache_metadata:,
|
|
212
|
+
# Plain-text passages relevant to highlightsParams.query, in page order, each
|
|
213
|
+
# prefixed with its section heading in square brackets. Empty when the page has no
|
|
214
|
+
# text.
|
|
215
|
+
highlights:,
|
|
171
216
|
# Rendered HTML after content filters.
|
|
172
217
|
html:,
|
|
173
218
|
# Images after content filters. Empty when none are found.
|
|
174
219
|
images:,
|
|
220
|
+
# Page data extracted into jsonParams.schema, after shared content filters. Values
|
|
221
|
+
# are grounded in the page; optional fields the page does not state are omitted,
|
|
222
|
+
# or null when their type allows null. An empty object when the filters leave no
|
|
223
|
+
# text.
|
|
224
|
+
json:,
|
|
175
225
|
# Markdown after content filters.
|
|
176
226
|
markdown:,
|
|
177
227
|
# Page details, when available.
|
|
178
228
|
metadata:,
|
|
179
229
|
# Fields produced by parseParams.rules, after shared content filters.
|
|
180
230
|
parsed:,
|
|
231
|
+
# Product detail page classification and the extracted product.
|
|
232
|
+
product:,
|
|
181
233
|
# Unique id of this API call, also sent in the X-Request-Id response header. Quote
|
|
182
234
|
# it when contacting support about a failed request.
|
|
183
235
|
request_id:,
|
|
@@ -185,8 +237,10 @@ module ContextDev
|
|
|
185
237
|
screenshot:,
|
|
186
238
|
# Final URL after redirects and browser actions.
|
|
187
239
|
url:,
|
|
188
|
-
# Present when return-partial captures a page that is still loading
|
|
189
|
-
# images before image processing finishes
|
|
240
|
+
# Present when return-partial captures a page that is still loading, returns
|
|
241
|
+
# images before image processing finishes, or cuts product AI extraction short.
|
|
242
|
+
# Also present if the optional product AI fallback fails. Partial responses are
|
|
243
|
+
# not cached.
|
|
190
244
|
is_partial: nil,
|
|
191
245
|
# Credit usage, included whenever a valid API key is provided.
|
|
192
246
|
key_metadata: nil
|
|
@@ -199,11 +253,14 @@ module ContextDev
|
|
|
199
253
|
bytes: ContextDev::Models::WebScrapeResponse::Bytes,
|
|
200
254
|
cache_metadata:
|
|
201
255
|
ContextDev::Models::WebScrapeResponse::CacheMetadata,
|
|
256
|
+
highlights: ContextDev::Models::WebScrapeResponse::Highlights,
|
|
202
257
|
html: ContextDev::Models::WebScrapeResponse::HTML,
|
|
203
258
|
images: ContextDev::Models::WebScrapeResponse::Images,
|
|
259
|
+
json: ContextDev::Models::WebScrapeResponse::Json,
|
|
204
260
|
markdown: ContextDev::Models::WebScrapeResponse::Markdown,
|
|
205
261
|
metadata: ContextDev::Models::WebScrapeResponse::Metadata,
|
|
206
262
|
parsed: ContextDev::Models::WebScrapeResponse::Parsed,
|
|
263
|
+
product: ContextDev::Models::WebScrapeResponse::Product,
|
|
207
264
|
request_id: String,
|
|
208
265
|
screenshot: ContextDev::Models::WebScrapeResponse::Screenshot,
|
|
209
266
|
url: String,
|
|
@@ -400,6 +457,42 @@ module ContextDev
|
|
|
400
457
|
end
|
|
401
458
|
end
|
|
402
459
|
|
|
460
|
+
class Highlights < ContextDev::Internal::Type::BaseModel
|
|
461
|
+
OrHash =
|
|
462
|
+
T.type_alias do
|
|
463
|
+
T.any(
|
|
464
|
+
ContextDev::Models::WebScrapeResponse::Highlights,
|
|
465
|
+
ContextDev::Internal::AnyHash
|
|
466
|
+
)
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
470
|
+
attr_accessor :data
|
|
471
|
+
|
|
472
|
+
sig { returns(T::Boolean) }
|
|
473
|
+
attr_accessor :requested
|
|
474
|
+
|
|
475
|
+
# Plain-text passages relevant to highlightsParams.query, in page order, each
|
|
476
|
+
# prefixed with its section heading in square brackets. Empty when the page has no
|
|
477
|
+
# text.
|
|
478
|
+
sig do
|
|
479
|
+
params(
|
|
480
|
+
data: T.nilable(T::Array[String]),
|
|
481
|
+
requested: T::Boolean
|
|
482
|
+
).returns(T.attached_class)
|
|
483
|
+
end
|
|
484
|
+
def self.new(data:, requested:)
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
sig do
|
|
488
|
+
override.returns(
|
|
489
|
+
{ data: T.nilable(T::Array[String]), requested: T::Boolean }
|
|
490
|
+
)
|
|
491
|
+
end
|
|
492
|
+
def to_hash
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
|
|
403
496
|
class HTML < ContextDev::Internal::Type::BaseModel
|
|
404
497
|
OrHash =
|
|
405
498
|
T.type_alias do
|
|
@@ -642,6 +735,46 @@ module ContextDev
|
|
|
642
735
|
end
|
|
643
736
|
end
|
|
644
737
|
|
|
738
|
+
class Json < ContextDev::Internal::Type::BaseModel
|
|
739
|
+
OrHash =
|
|
740
|
+
T.type_alias do
|
|
741
|
+
T.any(
|
|
742
|
+
ContextDev::Models::WebScrapeResponse::Json,
|
|
743
|
+
ContextDev::Internal::AnyHash
|
|
744
|
+
)
|
|
745
|
+
end
|
|
746
|
+
|
|
747
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
748
|
+
attr_accessor :data
|
|
749
|
+
|
|
750
|
+
sig { returns(T::Boolean) }
|
|
751
|
+
attr_accessor :requested
|
|
752
|
+
|
|
753
|
+
# Page data extracted into jsonParams.schema, after shared content filters. Values
|
|
754
|
+
# are grounded in the page; optional fields the page does not state are omitted,
|
|
755
|
+
# or null when their type allows null. An empty object when the filters leave no
|
|
756
|
+
# text.
|
|
757
|
+
sig do
|
|
758
|
+
params(
|
|
759
|
+
data: T.nilable(T::Hash[Symbol, T.anything]),
|
|
760
|
+
requested: T::Boolean
|
|
761
|
+
).returns(T.attached_class)
|
|
762
|
+
end
|
|
763
|
+
def self.new(data:, requested:)
|
|
764
|
+
end
|
|
765
|
+
|
|
766
|
+
sig do
|
|
767
|
+
override.returns(
|
|
768
|
+
{
|
|
769
|
+
data: T.nilable(T::Hash[Symbol, T.anything]),
|
|
770
|
+
requested: T::Boolean
|
|
771
|
+
}
|
|
772
|
+
)
|
|
773
|
+
end
|
|
774
|
+
def to_hash
|
|
775
|
+
end
|
|
776
|
+
end
|
|
777
|
+
|
|
645
778
|
class Markdown < ContextDev::Internal::Type::BaseModel
|
|
646
779
|
OrHash =
|
|
647
780
|
T.type_alias do
|
|
@@ -1213,6 +1346,429 @@ module ContextDev
|
|
|
1213
1346
|
end
|
|
1214
1347
|
end
|
|
1215
1348
|
|
|
1349
|
+
class Product < ContextDev::Internal::Type::BaseModel
|
|
1350
|
+
OrHash =
|
|
1351
|
+
T.type_alias do
|
|
1352
|
+
T.any(
|
|
1353
|
+
ContextDev::Models::WebScrapeResponse::Product,
|
|
1354
|
+
ContextDev::Internal::AnyHash
|
|
1355
|
+
)
|
|
1356
|
+
end
|
|
1357
|
+
|
|
1358
|
+
sig do
|
|
1359
|
+
returns(
|
|
1360
|
+
T.nilable(ContextDev::Models::WebScrapeResponse::Product::Data)
|
|
1361
|
+
)
|
|
1362
|
+
end
|
|
1363
|
+
attr_reader :data
|
|
1364
|
+
|
|
1365
|
+
sig do
|
|
1366
|
+
params(
|
|
1367
|
+
data:
|
|
1368
|
+
T.nilable(
|
|
1369
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::OrHash
|
|
1370
|
+
)
|
|
1371
|
+
).void
|
|
1372
|
+
end
|
|
1373
|
+
attr_writer :data
|
|
1374
|
+
|
|
1375
|
+
sig { returns(T::Boolean) }
|
|
1376
|
+
attr_accessor :requested
|
|
1377
|
+
|
|
1378
|
+
# Product detail page classification and the extracted product.
|
|
1379
|
+
sig do
|
|
1380
|
+
params(
|
|
1381
|
+
data:
|
|
1382
|
+
T.nilable(
|
|
1383
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::OrHash
|
|
1384
|
+
),
|
|
1385
|
+
requested: T::Boolean
|
|
1386
|
+
).returns(T.attached_class)
|
|
1387
|
+
end
|
|
1388
|
+
def self.new(data:, requested:)
|
|
1389
|
+
end
|
|
1390
|
+
|
|
1391
|
+
sig do
|
|
1392
|
+
override.returns(
|
|
1393
|
+
{
|
|
1394
|
+
data:
|
|
1395
|
+
T.nilable(ContextDev::Models::WebScrapeResponse::Product::Data),
|
|
1396
|
+
requested: T::Boolean
|
|
1397
|
+
}
|
|
1398
|
+
)
|
|
1399
|
+
end
|
|
1400
|
+
def to_hash
|
|
1401
|
+
end
|
|
1402
|
+
|
|
1403
|
+
class Data < ContextDev::Internal::Type::BaseModel
|
|
1404
|
+
OrHash =
|
|
1405
|
+
T.type_alias do
|
|
1406
|
+
T.any(
|
|
1407
|
+
ContextDev::Models::WebScrapeResponse::Product::Data,
|
|
1408
|
+
ContextDev::Internal::AnyHash
|
|
1409
|
+
)
|
|
1410
|
+
end
|
|
1411
|
+
|
|
1412
|
+
# Whether the page is a product detail page.
|
|
1413
|
+
sig { returns(T::Boolean) }
|
|
1414
|
+
attr_accessor :is_product_page
|
|
1415
|
+
|
|
1416
|
+
# The extracted product, or null when the page is not a product detail page.
|
|
1417
|
+
sig do
|
|
1418
|
+
returns(
|
|
1419
|
+
T.nilable(
|
|
1420
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product
|
|
1421
|
+
)
|
|
1422
|
+
)
|
|
1423
|
+
end
|
|
1424
|
+
attr_reader :product
|
|
1425
|
+
|
|
1426
|
+
sig do
|
|
1427
|
+
params(
|
|
1428
|
+
product:
|
|
1429
|
+
T.nilable(
|
|
1430
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::OrHash
|
|
1431
|
+
)
|
|
1432
|
+
).void
|
|
1433
|
+
end
|
|
1434
|
+
attr_writer :product
|
|
1435
|
+
|
|
1436
|
+
sig do
|
|
1437
|
+
params(
|
|
1438
|
+
is_product_page: T::Boolean,
|
|
1439
|
+
product:
|
|
1440
|
+
T.nilable(
|
|
1441
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::OrHash
|
|
1442
|
+
)
|
|
1443
|
+
).returns(T.attached_class)
|
|
1444
|
+
end
|
|
1445
|
+
def self.new(
|
|
1446
|
+
# Whether the page is a product detail page.
|
|
1447
|
+
is_product_page:,
|
|
1448
|
+
# The extracted product, or null when the page is not a product detail page.
|
|
1449
|
+
product:
|
|
1450
|
+
)
|
|
1451
|
+
end
|
|
1452
|
+
|
|
1453
|
+
sig do
|
|
1454
|
+
override.returns(
|
|
1455
|
+
{
|
|
1456
|
+
is_product_page: T::Boolean,
|
|
1457
|
+
product:
|
|
1458
|
+
T.nilable(
|
|
1459
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product
|
|
1460
|
+
)
|
|
1461
|
+
}
|
|
1462
|
+
)
|
|
1463
|
+
end
|
|
1464
|
+
def to_hash
|
|
1465
|
+
end
|
|
1466
|
+
|
|
1467
|
+
class Product < ContextDev::Internal::Type::BaseModel
|
|
1468
|
+
OrHash =
|
|
1469
|
+
T.type_alias do
|
|
1470
|
+
T.any(
|
|
1471
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product,
|
|
1472
|
+
ContextDev::Internal::AnyHash
|
|
1473
|
+
)
|
|
1474
|
+
end
|
|
1475
|
+
|
|
1476
|
+
# Stock or ordering availability.
|
|
1477
|
+
sig do
|
|
1478
|
+
returns(
|
|
1479
|
+
T.nilable(
|
|
1480
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1481
|
+
)
|
|
1482
|
+
)
|
|
1483
|
+
end
|
|
1484
|
+
attr_accessor :availability
|
|
1485
|
+
|
|
1486
|
+
# Brand or vendor.
|
|
1487
|
+
sig { returns(T.nilable(String)) }
|
|
1488
|
+
attr_accessor :brand
|
|
1489
|
+
|
|
1490
|
+
# Product category.
|
|
1491
|
+
sig { returns(T.nilable(String)) }
|
|
1492
|
+
attr_accessor :category
|
|
1493
|
+
|
|
1494
|
+
# ISO 4217 currency code.
|
|
1495
|
+
sig { returns(T.nilable(String)) }
|
|
1496
|
+
attr_accessor :currency
|
|
1497
|
+
|
|
1498
|
+
# Product description.
|
|
1499
|
+
sig { returns(T.nilable(String)) }
|
|
1500
|
+
attr_accessor :description
|
|
1501
|
+
|
|
1502
|
+
# Product dimensions as shown on the page.
|
|
1503
|
+
sig { returns(T::Array[String]) }
|
|
1504
|
+
attr_accessor :dimensions
|
|
1505
|
+
|
|
1506
|
+
# Key features and specifications.
|
|
1507
|
+
sig { returns(T::Array[String]) }
|
|
1508
|
+
attr_accessor :features
|
|
1509
|
+
|
|
1510
|
+
# Product image URLs, main image first.
|
|
1511
|
+
sig { returns(T::Array[String]) }
|
|
1512
|
+
attr_accessor :images
|
|
1513
|
+
|
|
1514
|
+
# Main product image URL.
|
|
1515
|
+
sig { returns(T.nilable(String)) }
|
|
1516
|
+
attr_accessor :image_url
|
|
1517
|
+
|
|
1518
|
+
# Product name.
|
|
1519
|
+
sig { returns(String) }
|
|
1520
|
+
attr_accessor :name
|
|
1521
|
+
|
|
1522
|
+
# Current price.
|
|
1523
|
+
sig { returns(T.nilable(Float)) }
|
|
1524
|
+
attr_accessor :price
|
|
1525
|
+
|
|
1526
|
+
# List price before any discount.
|
|
1527
|
+
sig { returns(T.nilable(Float)) }
|
|
1528
|
+
attr_accessor :regular_price
|
|
1529
|
+
|
|
1530
|
+
# Product identifier such as a SKU or model number.
|
|
1531
|
+
sig { returns(T.nilable(String)) }
|
|
1532
|
+
attr_accessor :sku
|
|
1533
|
+
|
|
1534
|
+
# Product tags.
|
|
1535
|
+
sig { returns(T::Array[String]) }
|
|
1536
|
+
attr_accessor :tags
|
|
1537
|
+
|
|
1538
|
+
# Intended audience.
|
|
1539
|
+
sig { returns(T::Array[String]) }
|
|
1540
|
+
attr_accessor :target_audience
|
|
1541
|
+
|
|
1542
|
+
# Product variations, such as different colors or sizes, with their attributes and
|
|
1543
|
+
# images. Empty if none are found. May not include every variation offered by the
|
|
1544
|
+
# store.
|
|
1545
|
+
sig do
|
|
1546
|
+
returns(
|
|
1547
|
+
T::Array[
|
|
1548
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant
|
|
1549
|
+
]
|
|
1550
|
+
)
|
|
1551
|
+
end
|
|
1552
|
+
attr_accessor :variants
|
|
1553
|
+
|
|
1554
|
+
# The extracted product, or null when the page is not a product detail page.
|
|
1555
|
+
sig do
|
|
1556
|
+
params(
|
|
1557
|
+
availability:
|
|
1558
|
+
T.nilable(
|
|
1559
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::OrSymbol
|
|
1560
|
+
),
|
|
1561
|
+
brand: T.nilable(String),
|
|
1562
|
+
category: T.nilable(String),
|
|
1563
|
+
currency: T.nilable(String),
|
|
1564
|
+
description: T.nilable(String),
|
|
1565
|
+
dimensions: T::Array[String],
|
|
1566
|
+
features: T::Array[String],
|
|
1567
|
+
images: T::Array[String],
|
|
1568
|
+
image_url: T.nilable(String),
|
|
1569
|
+
name: String,
|
|
1570
|
+
price: T.nilable(Float),
|
|
1571
|
+
regular_price: T.nilable(Float),
|
|
1572
|
+
sku: T.nilable(String),
|
|
1573
|
+
tags: T::Array[String],
|
|
1574
|
+
target_audience: T::Array[String],
|
|
1575
|
+
variants:
|
|
1576
|
+
T::Array[
|
|
1577
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant::OrHash
|
|
1578
|
+
]
|
|
1579
|
+
).returns(T.attached_class)
|
|
1580
|
+
end
|
|
1581
|
+
def self.new(
|
|
1582
|
+
# Stock or ordering availability.
|
|
1583
|
+
availability:,
|
|
1584
|
+
# Brand or vendor.
|
|
1585
|
+
brand:,
|
|
1586
|
+
# Product category.
|
|
1587
|
+
category:,
|
|
1588
|
+
# ISO 4217 currency code.
|
|
1589
|
+
currency:,
|
|
1590
|
+
# Product description.
|
|
1591
|
+
description:,
|
|
1592
|
+
# Product dimensions as shown on the page.
|
|
1593
|
+
dimensions:,
|
|
1594
|
+
# Key features and specifications.
|
|
1595
|
+
features:,
|
|
1596
|
+
# Product image URLs, main image first.
|
|
1597
|
+
images:,
|
|
1598
|
+
# Main product image URL.
|
|
1599
|
+
image_url:,
|
|
1600
|
+
# Product name.
|
|
1601
|
+
name:,
|
|
1602
|
+
# Current price.
|
|
1603
|
+
price:,
|
|
1604
|
+
# List price before any discount.
|
|
1605
|
+
regular_price:,
|
|
1606
|
+
# Product identifier such as a SKU or model number.
|
|
1607
|
+
sku:,
|
|
1608
|
+
# Product tags.
|
|
1609
|
+
tags:,
|
|
1610
|
+
# Intended audience.
|
|
1611
|
+
target_audience:,
|
|
1612
|
+
# Product variations, such as different colors or sizes, with their attributes and
|
|
1613
|
+
# images. Empty if none are found. May not include every variation offered by the
|
|
1614
|
+
# store.
|
|
1615
|
+
variants:
|
|
1616
|
+
)
|
|
1617
|
+
end
|
|
1618
|
+
|
|
1619
|
+
sig do
|
|
1620
|
+
override.returns(
|
|
1621
|
+
{
|
|
1622
|
+
availability:
|
|
1623
|
+
T.nilable(
|
|
1624
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1625
|
+
),
|
|
1626
|
+
brand: T.nilable(String),
|
|
1627
|
+
category: T.nilable(String),
|
|
1628
|
+
currency: T.nilable(String),
|
|
1629
|
+
description: T.nilable(String),
|
|
1630
|
+
dimensions: T::Array[String],
|
|
1631
|
+
features: T::Array[String],
|
|
1632
|
+
images: T::Array[String],
|
|
1633
|
+
image_url: T.nilable(String),
|
|
1634
|
+
name: String,
|
|
1635
|
+
price: T.nilable(Float),
|
|
1636
|
+
regular_price: T.nilable(Float),
|
|
1637
|
+
sku: T.nilable(String),
|
|
1638
|
+
tags: T::Array[String],
|
|
1639
|
+
target_audience: T::Array[String],
|
|
1640
|
+
variants:
|
|
1641
|
+
T::Array[
|
|
1642
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant
|
|
1643
|
+
]
|
|
1644
|
+
}
|
|
1645
|
+
)
|
|
1646
|
+
end
|
|
1647
|
+
def to_hash
|
|
1648
|
+
end
|
|
1649
|
+
|
|
1650
|
+
# Stock or ordering availability.
|
|
1651
|
+
module Availability
|
|
1652
|
+
extend ContextDev::Internal::Type::Enum
|
|
1653
|
+
|
|
1654
|
+
TaggedSymbol =
|
|
1655
|
+
T.type_alias do
|
|
1656
|
+
T.all(
|
|
1657
|
+
Symbol,
|
|
1658
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability
|
|
1659
|
+
)
|
|
1660
|
+
end
|
|
1661
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1662
|
+
|
|
1663
|
+
IN_STOCK =
|
|
1664
|
+
T.let(
|
|
1665
|
+
:in_stock,
|
|
1666
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1667
|
+
)
|
|
1668
|
+
OUT_OF_STOCK =
|
|
1669
|
+
T.let(
|
|
1670
|
+
:out_of_stock,
|
|
1671
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1672
|
+
)
|
|
1673
|
+
LIMITED_AVAILABILITY =
|
|
1674
|
+
T.let(
|
|
1675
|
+
:limited_availability,
|
|
1676
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1677
|
+
)
|
|
1678
|
+
PREORDER =
|
|
1679
|
+
T.let(
|
|
1680
|
+
:preorder,
|
|
1681
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1682
|
+
)
|
|
1683
|
+
BACKORDER =
|
|
1684
|
+
T.let(
|
|
1685
|
+
:backorder,
|
|
1686
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1687
|
+
)
|
|
1688
|
+
MADE_TO_ORDER =
|
|
1689
|
+
T.let(
|
|
1690
|
+
:made_to_order,
|
|
1691
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1692
|
+
)
|
|
1693
|
+
DISCONTINUED =
|
|
1694
|
+
T.let(
|
|
1695
|
+
:discontinued,
|
|
1696
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1697
|
+
)
|
|
1698
|
+
|
|
1699
|
+
sig do
|
|
1700
|
+
override.returns(
|
|
1701
|
+
T::Array[
|
|
1702
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Availability::TaggedSymbol
|
|
1703
|
+
]
|
|
1704
|
+
)
|
|
1705
|
+
end
|
|
1706
|
+
def self.values
|
|
1707
|
+
end
|
|
1708
|
+
end
|
|
1709
|
+
|
|
1710
|
+
class Variant < ContextDev::Internal::Type::BaseModel
|
|
1711
|
+
OrHash =
|
|
1712
|
+
T.type_alias do
|
|
1713
|
+
T.any(
|
|
1714
|
+
ContextDev::Models::WebScrapeResponse::Product::Data::Product::Variant,
|
|
1715
|
+
ContextDev::Internal::AnyHash
|
|
1716
|
+
)
|
|
1717
|
+
end
|
|
1718
|
+
|
|
1719
|
+
# Explicit variant attributes such as color, size, material, pattern and
|
|
1720
|
+
# properties declared by page.
|
|
1721
|
+
sig { returns(T::Hash[Symbol, String]) }
|
|
1722
|
+
attr_accessor :attributes
|
|
1723
|
+
|
|
1724
|
+
# Original source image URLs explicitly attached to this variant.
|
|
1725
|
+
sig { returns(T::Array[String]) }
|
|
1726
|
+
attr_accessor :images
|
|
1727
|
+
|
|
1728
|
+
sig { returns(T.nilable(String)) }
|
|
1729
|
+
attr_accessor :sku
|
|
1730
|
+
|
|
1731
|
+
# Variant or offer URL when provided by the source. May be shared by variants.
|
|
1732
|
+
sig { returns(T.nilable(String)) }
|
|
1733
|
+
attr_accessor :url
|
|
1734
|
+
|
|
1735
|
+
sig do
|
|
1736
|
+
params(
|
|
1737
|
+
attributes: T::Hash[Symbol, String],
|
|
1738
|
+
images: T::Array[String],
|
|
1739
|
+
sku: T.nilable(String),
|
|
1740
|
+
url: T.nilable(String)
|
|
1741
|
+
).returns(T.attached_class)
|
|
1742
|
+
end
|
|
1743
|
+
def self.new(
|
|
1744
|
+
# Explicit variant attributes such as color, size, material, pattern and
|
|
1745
|
+
# properties declared by page.
|
|
1746
|
+
attributes:,
|
|
1747
|
+
# Original source image URLs explicitly attached to this variant.
|
|
1748
|
+
images:,
|
|
1749
|
+
sku:,
|
|
1750
|
+
# Variant or offer URL when provided by the source. May be shared by variants.
|
|
1751
|
+
url:
|
|
1752
|
+
)
|
|
1753
|
+
end
|
|
1754
|
+
|
|
1755
|
+
sig do
|
|
1756
|
+
override.returns(
|
|
1757
|
+
{
|
|
1758
|
+
attributes: T::Hash[Symbol, String],
|
|
1759
|
+
images: T::Array[String],
|
|
1760
|
+
sku: T.nilable(String),
|
|
1761
|
+
url: T.nilable(String)
|
|
1762
|
+
}
|
|
1763
|
+
)
|
|
1764
|
+
end
|
|
1765
|
+
def to_hash
|
|
1766
|
+
end
|
|
1767
|
+
end
|
|
1768
|
+
end
|
|
1769
|
+
end
|
|
1770
|
+
end
|
|
1771
|
+
|
|
1216
1772
|
class Screenshot < ContextDev::Internal::Type::BaseModel
|
|
1217
1773
|
OrHash =
|
|
1218
1774
|
T.type_alias do
|
|
@@ -1244,8 +1800,10 @@ module ContextDev
|
|
|
1244
1800
|
end
|
|
1245
1801
|
end
|
|
1246
1802
|
|
|
1247
|
-
# Present when return-partial captures a page that is still loading
|
|
1248
|
-
# images before image processing finishes
|
|
1803
|
+
# Present when return-partial captures a page that is still loading, returns
|
|
1804
|
+
# images before image processing finishes, or cuts product AI extraction short.
|
|
1805
|
+
# Also present if the optional product AI fallback fails. Partial responses are
|
|
1806
|
+
# not cached.
|
|
1249
1807
|
module IsPartial
|
|
1250
1808
|
extend ContextDev::Internal::Type::Enum
|
|
1251
1809
|
|