/** * AI Configuration Service * * Central registry for choosing which AI models handle specific tasks. * This can be updated by the user to switch between Lite/Pro or Free/Paid tiers. */ export type AiTask = 'SAV_OCR' | 'CHART_INTERPRETATION' | 'DASA_ANALYSIS' | 'LIFE_SUMMARY'; export const AI_CONFIG = { tasks: { 'SAV_OCR': { primary: 'gemini-3.1-flash-lite', secondary: 'gemini-2.5-flash-lite', fallbackStrategy: 'sequential' as const, }, 'CHART_INTERPRETATION': { primary: 'gemini-3.1-pro', secondary: 'gemini-2.5-flash', fallbackStrategy: 'sequential' as const, } }, // Environment variable keys keys: { gemini: import.meta.env.VITE_GEMINI_API_KEY, } }; /** * Gets the current preferred models for a given task. */ export function getModelsForTask(task: AiTask) { return AI_CONFIG.tasks[task as keyof typeof AI_CONFIG.tasks] || AI_CONFIG.tasks['SAV_OCR']; }