You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Template for rendering product information as markdown to provide information to LLMs
26
25
PRODUCT_TEMPLATE="""
27
26
# {{ title }}
@@ -42,48 +41,45 @@
42
41
"""
43
42
44
43
45
-
@dataclasses.dataclass
46
-
classProductInfo:
44
+
classProductInfo(BaseModel):
47
45
id: str
48
46
title: str
49
47
price: float
50
48
detail: str
51
49
52
50
53
-
@dataclasses.dataclass
54
-
classProductTaxonomy:
51
+
classProductTaxonomy(BaseModel):
55
52
"""
56
53
Taxonomy for the product.
57
-
58
-
A taxonomy is a concise noun (or short noun phrase), based on its core functionality, without specific details such as branding, style, etc.
59
-
60
-
Always use the most common words in US English.
61
-
62
-
Use lowercase without punctuation, unless it's a proper noun or acronym.
63
-
64
-
A product may have multiple taxonomies. Avoid large categories like "office supplies" or "electronics". Use specific ones, like "pen" or "printer".
65
54
"""
66
55
67
-
name: str
56
+
name: str=Field(
57
+
description="A taxonomy is a concise noun (or short noun phrase), based on its core functionality, "
58
+
"without specific details such as branding, style, etc. Always use the most common words in US "
59
+
"English. Use lowercase without punctuation, unless it's a proper noun or acronym. A product may "
60
+
"have multiple taxonomies. Avoid large categories like 'office supplies' or 'electronics'. Use "
61
+
"specific ones, like 'pen' or 'printer'."
62
+
)
68
63
69
64
70
-
@dataclasses.dataclass
71
-
classProductTaxonomyInfo:
65
+
classProductTaxonomyInfo(BaseModel):
72
66
"""
73
67
Taxonomy information for the product.
74
-
75
-
Fields:
76
-
- taxonomies: Taxonomies for the current product.
77
-
- complementary_taxonomies: Think about when customers buy this product, what else they might need as complementary products. Put labels for these complentary products.
0 commit comments