Merge pull request #236 from R0m1k3/antigravity

feat: Add AI extraction schemas and prompt templates, and refine pric…
This commit is contained in:
LogiFlow authored and GitHub committed 2025-12-18 17:02:43 +01:00
commit 38b64053eb
3 files changed
+9 -3

No files matched your search

+5 -2
View File
@@ -142,8 +142,11 @@ EXTRACTION_PROMPT_TEMPLATE = """Extract product price and stock status from this
- Extract as DECIMAL NUMBER: If you see "3.99", return 3.99
- Ignore crossed-out/barré prices (old prices)
- **CRITICAL:** Ignore "Prix au litre", "Prix au kg", "P.U.", or unit prices usually shown in smaller text/parentheses (e.g., "4.60 € / L").
- If multiple prices, take the current/main price (not the original, not the unit price)
- **B&M STORES Specific:** The main price is often large and bold (e.g. "1.15€"), while unit price is small (e.g. "4.60 €/L"). ALWAYS take the main price.
- **CRITICAL:** If you see both HT (Hors Taxe) and TTC (Toutes Taxes Comprises) prices, **ALWAYS select the TTC price**.
- Look for labels like "Taxe incluse", "TTC", "Prix payé". Ignore "HT" or "Hors Taxe".
- Example: If text has "1.15 € HT" and "1.38 € TTC", return 1.38 (NOT 1.15).
- If multiple prices, take the current/main price (not the original, not the unit price, not the HT price)
- **B&M STORES Specific:** The main price is often large and bold (e.g. "1.38€"), while unit price is small. ALWAYS take the main price (TTC). Ignore hidden HT prices (e.g. 1.15€).
**CRITICAL - Common mistakes to avoid:**
- "3.99 €" means 3.99 (NOT 399.00, NOT 3990.00)
+1
View File
@@ -37,3 +37,4 @@ Improving price extraction reliability for B&M Stores and others.
- Improved AI prompt to ignore unit prices (like "Prix au litre").
- Enhanced text extraction to remove menu/footer noise.
- Verified logic with `verify_extraction_logic.py` (simulated).
- **Fixed HT vs TTC issue**: AI was extracting 1.15€ (HT) instead of 1.38€ (TTC). Updated prompt to prioritize "Taxe incluse"/TTC prices.
+3 -1
View File
@@ -118,7 +118,9 @@ async def verify_extraction_logic():
"CRITICAL",
"Ignore \"Prix au litre\"",
"B&M STORES Specific",
"Extract as DECIMAL NUMBER"
"Extract as DECIMAL NUMBER",
"ALWAYS select the TTC price",
"Ignore \"HT\""
]
all_passed = True