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

@@ -0,0 +1,4 @@
ALTER TABLE `importSettings` ADD `aiProvider` enum('mistral','manus') DEFAULT 'mistral' NOT NULL;--> statement-breakpoint
ALTER TABLE `importSettings` ADD `mistralApiKey` text;--> statement-breakpoint
ALTER TABLE `importSettings` ADD `manusForgeApiKey` text;--> statement-breakpoint
ALTER TABLE `importSettings` ADD `manusForgeApiUrl` text;

View File

@@ -0,0 +1,4 @@
ALTER TABLE `userSettings` ADD `aiProvider` enum('mistral','manus') DEFAULT 'mistral' NOT NULL;--> statement-breakpoint
ALTER TABLE `userSettings` ADD `mistralApiKey` text;--> statement-breakpoint
ALTER TABLE `userSettings` ADD `manusForgeApiKey` text;--> statement-breakpoint
ALTER TABLE `userSettings` ADD `manusForgeApiUrl` text;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -141,6 +141,20 @@
"when": 1776021930426,
"tag": "0019_smooth_lord_hawal",
"breakpoints": true
},
{
"idx": 20,
"version": "5",
"when": 1776253931726,
"tag": "0020_overrated_nekra",
"breakpoints": true
},
{
"idx": 21,
"version": "5",
"when": 1776254066006,
"tag": "0021_unique_speed",
"breakpoints": true
}
]
}

View File

@@ -148,6 +148,11 @@ export const userSettings = mysqlTable("userSettings", {
llmLogsRetentionMonths: int("llmLogsRetentionMonths").default(3).notNull(), // Durée de conservation des logs LLM en mois (défaut: 3 mois)
// Seuil de confiance pour les apprentissages IA
learningConfidenceThreshold: int("learningConfidenceThreshold").default(2).notNull(), // Nombre minimum d'applications pour marquer un apprentissage comme Confirmé
// AI Engine configuration
aiProvider: mysqlEnum("aiProvider", ["mistral", "manus"]).default("mistral").notNull(), // AI provider: 'mistral' or 'manus'
mistralApiKey: text("mistralApiKey"), // Mistral API key (overrides env MISTRAL_API_KEY)
manusForgeApiKey: text("manusForgeApiKey"), // Manus Forge API key (overrides env BUILT_IN_FORGE_API_KEY)
manusForgeApiUrl: text("manusForgeApiUrl"), // Manus Forge API URL (overrides env BUILT_IN_FORGE_API_URL)
createdAt: timestamp("createdAt").defaultNow().notNull(),
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
});
@@ -181,7 +186,13 @@ export const importSettings = mysqlTable("importSettings", {
// Export folder settings
exportFolder: text("exportFolder"), // Path to folder for exporting invoices
bapExportMode: mysqlEnum("bapExportMode", ["browser", "folder"]).default("browser").notNull(), // BAP export mode: open in browser or save to folder
// AI Engine settings
aiProvider: mysqlEnum("aiProvider", ["mistral", "manus"]).default("mistral").notNull(), // AI provider for invoice extraction
mistralApiKey: text("mistralApiKey"), // Mistral API key (overrides env MISTRAL_API_KEY)
manusForgeApiKey: text("manusForgeApiKey"), // Manus Forge API key (overrides env BUILT_IN_FORGE_API_KEY)
manusForgeApiUrl: text("manusForgeApiUrl"), // Manus Forge API URL (overrides env BUILT_IN_FORGE_API_URL)
createdAt: timestamp("createdAt").defaultNow().notNull(),
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
});