mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-05-05 05:42:47 +02:00
Add AI-powered price extraction fallback
- Add AI extraction service supporting Anthropic (Claude) and OpenAI - Add AI settings UI in Settings page with provider selection - Add database migration for AI settings columns - Integrate AI fallback into scraper when standard methods fail - Add API endpoints for AI settings and test extraction Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cfca33b4ea
commit
d98138fe7c
11 changed files with 887 additions and 10 deletions
|
|
@ -143,8 +143,39 @@ export const settingsApi = {
|
|||
|
||||
testDiscord: () =>
|
||||
api.post<{ message: string }>('/settings/notifications/test/discord'),
|
||||
|
||||
// AI Settings
|
||||
getAI: () =>
|
||||
api.get<AISettings>('/settings/ai'),
|
||||
|
||||
updateAI: (data: {
|
||||
ai_enabled?: boolean;
|
||||
ai_provider?: 'anthropic' | 'openai' | null;
|
||||
anthropic_api_key?: string | null;
|
||||
openai_api_key?: string | null;
|
||||
}) => api.put<AISettings & { message: string }>('/settings/ai', data),
|
||||
|
||||
testAI: (url: string) =>
|
||||
api.post<AITestResult>('/settings/ai/test', { url }),
|
||||
};
|
||||
|
||||
// AI Settings types
|
||||
export interface AISettings {
|
||||
ai_enabled: boolean;
|
||||
ai_provider: 'anthropic' | 'openai' | null;
|
||||
anthropic_configured: boolean;
|
||||
openai_configured: boolean;
|
||||
}
|
||||
|
||||
export interface AITestResult {
|
||||
success: boolean;
|
||||
name: string | null;
|
||||
price: { price: number; currency: string } | null;
|
||||
imageUrl: string | null;
|
||||
stockStatus: string;
|
||||
confidence: number;
|
||||
}
|
||||
|
||||
// Profile API
|
||||
export interface UserProfile {
|
||||
id: number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue