Product discovery on names

This commit is contained in:
sriram
2026-10-06 11:57:01 +05:30
parent c0601b65fe
commit 34c65a7cbd
13 changed files with 569 additions and 24 deletions

View File

@@ -105,6 +105,11 @@ class DiscoveredProductIn(BaseModel):
listings: List[Dict[str, Any]] = Field(default_factory=list)
price_range: Optional[str] = None
retailer_count: int = 0
# The line and variant the preview grouped this row under. Web rows only
# need them sent back: their variant came from the retailer's brackets,
# which the plain product name no longer carries.
product_line: Optional[str] = None
variant: Optional[str] = None
class WebJobRequest(BaseModel):
@@ -245,7 +250,8 @@ async def ingest_brand_discovery(payload: DiscoveryIngestRequest) -> batch_commo
# them. Keyed by CSV position, which is how stage 11 reports source rows.
web_entries = {
index: {"listings": item.listings, "price_range": item.price_range or "",
"retailer_count": item.retailer_count}
"retailer_count": item.retailer_count,
"product_line": item.product_line or "", "variant": item.variant or ""}
for index, item in enumerate(payload.products) if item.listings
}
if web_entries: