fix: transmettre aiSettings (provider Manus) lors de l'import email
This commit is contained in:
@@ -86,15 +86,22 @@ async function processEmailAttachment(
|
|||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
const model = settings?.llmModel || "mistral-large-latest";
|
const model = settings?.llmModel || "mistral-large-latest";
|
||||||
|
const aiSettings = settings ? {
|
||||||
|
aiProvider: settings.aiProvider,
|
||||||
|
mistralApiKey: settings.mistralApiKey,
|
||||||
|
manusForgeApiKey: settings.manusForgeApiKey,
|
||||||
|
manusForgeApiUrl: settings.manusForgeApiUrl,
|
||||||
|
} : undefined;
|
||||||
|
|
||||||
// Extract invoices
|
// Extract invoices
|
||||||
console.log(`[EmailImport] Starting invoice extraction...`);
|
console.log(`[EmailImport] Starting invoice extraction (provider: ${aiSettings?.aiProvider || 'mistral'})...`);
|
||||||
const result = await extractInvoicesWithMistral(
|
const result = await extractInvoicesWithMistral(
|
||||||
fileBuffer,
|
fileBuffer,
|
||||||
userId,
|
userId,
|
||||||
sourceFile.id,
|
sourceFile.id,
|
||||||
model,
|
model,
|
||||||
customKeywords
|
customKeywords,
|
||||||
|
aiSettings
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(`[EmailImport] Extraction complete: ${result.invoiceCount} invoice(s) detected`);
|
console.log(`[EmailImport] Extraction complete: ${result.invoiceCount} invoice(s) detected`);
|
||||||
|
|||||||
Reference in New Issue
Block a user