diff --git a/intelligence/augorWorker.js b/intelligence/augorWorker.js index 5679524..421665d 100644 --- a/intelligence/augorWorker.js +++ b/intelligence/augorWorker.js @@ -125,7 +125,7 @@ async function runAugorWorker(archiveDb, intelligenceDb, config) { } } - setStatusByEventArticles.run(eventId); + for (const r of getEventArticleIds.all(eventId)) setStatusByArticleId.run(r.id); console.log(`[augor] processed event ${eventId} (${matchedCompanies.length} companies, ${eventArticles.length} articles)`); } catch (err) { @@ -168,7 +168,6 @@ async function callLlm(llmConfig, prompt) { model: llmConfig.model || "gpt-4o-mini", messages: [{ role: "user", content: prompt }], temperature: 0.1, - response_format: { type: "json_object" }, }); const baseUrl = llmConfig.baseUrl || "https://api.openai.com"; @@ -183,7 +182,8 @@ async function callLlm(llmConfig, prompt) { const content = parsed.choices?.[0]?.message?.content; if (!content) return null; - return JSON.parse(content); + const stripped = content.replace(/^```(?:json)?\s*/i, '').replace(/\s*```$/, '').trim(); + return JSON.parse(stripped); } function httpPost(url, body, headers) {