fix: Pass specific_role and increase timeout in API bridge (server.cjs)

This commit is contained in:
2025-12-29 14:22:26 +00:00
parent 4b79f1aee2
commit bd6aa34846

View File

@@ -174,7 +174,11 @@ app.post('/api/analyze-company', async (req, res) => {
// API-Endpunkt für generate-outreach
app.post('/api/generate-outreach', async (req, res) => {
console.log(`[${new Date().toISOString()}] HIT: /api/generate-outreach`);
const { companyData, knowledgeBase, referenceUrl } = req.body;
// Set a long timeout for this specific route (5 minutes)
req.setTimeout(300000);
const { companyData, knowledgeBase, referenceUrl, specific_role } = req.body;
if (!companyData || !knowledgeBase) {
return res.status(400).json({ error: 'Missing companyData or knowledgeBase' });
@@ -198,6 +202,10 @@ app.post('/api/generate-outreach', async (req, res) => {
'--reference_url', referenceUrl || ''
];
if (specific_role) {
scriptArgs.push('--specific_role', specific_role);
}
runPython(scriptArgs, res, [tempDataFilePath, tempContextFilePath]);
} catch (err) {