Checkpoint: Ajout de la section "Moteur IA" dans les paramètres : sélecteur Mistral/Manus, champs clé API avec affichage masqué, persistance en DB, migration VPS appliquée

This commit is contained in:
Manus
2026-04-15 08:04:54 -04:00
parent 7fbb3d5f2c
commit 62b7a61bf5
10 changed files with 3807 additions and 13 deletions

View File

@@ -200,6 +200,12 @@ export const appRouter = router({
} : undefined;
const model = settings?.llmModel || "mistral-large-latest";
const aiSettings = settings ? {
aiProvider: (settings as any).aiProvider || "mistral",
mistralApiKey: (settings as any).mistralApiKey || null,
manusForgeApiKey: (settings as any).manusForgeApiKey || null,
manusForgeApiUrl: (settings as any).manusForgeApiUrl || null,
} : undefined;
// Extract invoices
const result = await extractInvoicesWithMistral(
@@ -207,7 +213,8 @@ export const appRouter = router({
userId,
sourceFile.id,
model,
customKeywords
customKeywords,
aiSettings
);
// Update source file with total count
@@ -932,6 +939,10 @@ export const appRouter = router({
sftpAutoExport: z.number().optional(),
llmLogsRetentionMonths: z.number().optional(),
learningConfidenceThreshold: z.number().min(1).optional(),
aiProvider: z.enum(["mistral", "manus"]).optional(),
mistralApiKey: z.string().optional(),
manusForgeApiKey: z.string().optional(),
manusForgeApiUrl: z.string().optional(),
}))
.mutation(async ({ input, ctx }) => {
await upsertUserSettings({