fix: Pass specific_role and increase timeout in API bridge (server.cjs)
This commit is contained in:
@@ -174,7 +174,11 @@ app.post('/api/analyze-company', async (req, res) => {
|
|||||||
// API-Endpunkt für generate-outreach
|
// API-Endpunkt für generate-outreach
|
||||||
app.post('/api/generate-outreach', async (req, res) => {
|
app.post('/api/generate-outreach', async (req, res) => {
|
||||||
console.log(`[${new Date().toISOString()}] HIT: /api/generate-outreach`);
|
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) {
|
if (!companyData || !knowledgeBase) {
|
||||||
return res.status(400).json({ error: 'Missing companyData or 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 || ''
|
'--reference_url', referenceUrl || ''
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (specific_role) {
|
||||||
|
scriptArgs.push('--specific_role', specific_role);
|
||||||
|
}
|
||||||
|
|
||||||
runPython(scriptArgs, res, [tempDataFilePath, tempContextFilePath]);
|
runPython(scriptArgs, res, [tempDataFilePath, tempContextFilePath]);
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user