mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-11 17:29:14 +02:00
1.2 KiB
1.2 KiB
Walkthrough: Price Extraction & Catalog Fixes
1. Vision Priority Strategy
Problem: The AI was prioritizing text data (often hidden/outdated) over the visual price on the screenshot, extracting incorrect prices (e.g. 0.99€ instead of 1.27€).
Solution:
- Prompt Engineering: Rewrote the system prompt in
ai_schema.pyto explicitly declare the IMAGE AS THE SOURCE OF TRUTH. - Logic Fix: Disabled the
AIPriceExtractor(Text-only AI) inscheduler_service.pywhich was short-circuiting the logic before the Vision AI could run.
2. Catalog Scraper Fix
Problem: Catalogs were not updating because the browserless service was failing (likely blocked or network issues), preventing the scraper from loading cataloguemate.fr.
Solution:
- HTTP Fallback: Modified
cataloguemate_scraper.pyto use a robust fallback mechanism.- First attempts to use the secure Browserless browser.
- If that fails, it instantly falls back to a standard
httpxHTTP request, which is often sufficient for static catalog sites.
3. Cleanup
- Removed 20+ temporary debug/verification scripts (
debug_*.py,verify_*.py) from the root directory to keep the production environment clean.