Skip to content

Commit 2fdcf25

Browse files
author
stlc-bot
committed
feat(products): extract ProductGroup variants with images (#1124)
Stainless-Generated-From: 246f17c3ec7b1d004dc4e16d8d67ae2a1cee22c5
1 parent c8c4975 commit 2fdcf25

2 files changed

Lines changed: 50 additions & 4 deletions

File tree

‎src/context/dev/types/ai_extract_product_response.py‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Dict, List, Optional
44
from typing_extensions import Literal
55

66
from .._models import BaseModel
77

8-
__all__ = ["AIExtractProductResponse", "CacheMetadata", "KeyMetadata", "Product"]
8+
__all__ = ["AIExtractProductResponse", "CacheMetadata", "KeyMetadata", "Product", "ProductVariant"]
99

1010

1111
class CacheMetadata(BaseModel):
@@ -34,6 +34,22 @@ class KeyMetadata(BaseModel):
3434
"""Credits remaining for your organization."""
3535

3636

37+
class ProductVariant(BaseModel):
38+
attributes: Dict[str, str]
39+
"""
40+
Explicit variant attributes such as color, size, material, pattern and
41+
properties declared by page.
42+
"""
43+
44+
images: List[str]
45+
"""Original source image URLs explicitly attached to this variant."""
46+
47+
sku: Optional[str] = None
48+
49+
url: Optional[str] = None
50+
"""Variant or offer URL when provided by the source. May be shared by variants."""
51+
52+
3753
class Product(BaseModel):
3854
"""The extracted product data, or null if not a product page"""
3955

@@ -94,6 +110,13 @@ class Product(BaseModel):
94110
url: Optional[str] = None
95111
"""URL to the product page"""
96112

113+
variants: Optional[List[ProductVariant]] = None
114+
"""
115+
Product variations, such as different colors or sizes, with their attributes and
116+
images. Empty if none are found. May not include every variation offered by the
117+
store.
118+
"""
119+
97120

98121
class AIExtractProductResponse(BaseModel):
99122
cache_metadata: CacheMetadata

‎src/context/dev/types/ai_extract_products_response.py‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Dict, List, Optional
44
from typing_extensions import Literal
55

66
from .._models import BaseModel
77

8-
__all__ = ["AIExtractProductsResponse", "CacheMetadata", "KeyMetadata", "Product"]
8+
__all__ = ["AIExtractProductsResponse", "CacheMetadata", "KeyMetadata", "Product", "ProductVariant"]
99

1010

1111
class CacheMetadata(BaseModel):
@@ -34,6 +34,22 @@ class KeyMetadata(BaseModel):
3434
"""Credits remaining for your organization."""
3535

3636

37+
class ProductVariant(BaseModel):
38+
attributes: Dict[str, str]
39+
"""
40+
Explicit variant attributes such as color, size, material, pattern and
41+
properties declared by page.
42+
"""
43+
44+
images: List[str]
45+
"""Original source image URLs explicitly attached to this variant."""
46+
47+
sku: Optional[str] = None
48+
49+
url: Optional[str] = None
50+
"""Variant or offer URL when provided by the source. May be shared by variants."""
51+
52+
3753
class Product(BaseModel):
3854
description: str
3955
"""Description of the product"""
@@ -92,6 +108,13 @@ class Product(BaseModel):
92108
url: Optional[str] = None
93109
"""URL to the product page"""
94110

111+
variants: Optional[List[ProductVariant]] = None
112+
"""
113+
Product variations, such as different colors or sizes, with their attributes and
114+
images. Empty if none are found. May not include every variation offered by the
115+
store.
116+
"""
117+
95118

96119
class AIExtractProductsResponse(BaseModel):
97120
cache_metadata: CacheMetadata

0 commit comments

Comments
 (0)