Add AI price verification feature

When enabled, AI verifies every scraped price to ensure accuracy.
This catches issues like scraped "savings" amounts instead of actual prices.

- Add ai_verification_enabled column to users table
- Create verification prompt and functions for Anthropic, OpenAI, Ollama
- Integrate verification step into scraper after traditional scraping
- Add verification toggle to Settings page (separate from AI extraction)
- AI verification is independent of AI extraction fallback

Flow: Traditional scraping -> AI verification (if enabled) -> AI extraction fallback (if no price found)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
clucraft 2026-01-23 09:24:17 -05:00
parent 7afa3ccec3
commit dc4e7b9665
6 changed files with 278 additions and 4 deletions

View file

@ -196,6 +196,7 @@ export const settingsApi = {
updateAI: (data: {
ai_enabled?: boolean;
ai_verification_enabled?: boolean;
ai_provider?: 'anthropic' | 'openai' | 'ollama' | null;
anthropic_api_key?: string | null;
openai_api_key?: string | null;
@ -213,6 +214,7 @@ export const settingsApi = {
// AI Settings types
export interface AISettings {
ai_enabled: boolean;
ai_verification_enabled: boolean;
ai_provider: 'anthropic' | 'openai' | 'ollama' | null;
anthropic_api_key: string | null;
openai_api_key: string | null;