From 0fbdc21861f4feb60bbf6552e4b71c32de440426 Mon Sep 17 00:00:00 2001 From: ImBenji Date: Wed, 22 Apr 2026 21:02:46 +0100 Subject: [PATCH] add intelligence and SQL tabs to admin interface with corresponding API endpoints --- intelligence/augorWorker.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/intelligence/augorWorker.js b/intelligence/augorWorker.js index 421665d..033949d 100644 --- a/intelligence/augorWorker.js +++ b/intelligence/augorWorker.js @@ -178,7 +178,12 @@ async function callLlm(llmConfig, prompt) { "Authorization": `Bearer ${llmConfig.apiKey || ""}`, }); - const parsed = JSON.parse(responseText); + let parsed; + try { + parsed = JSON.parse(responseText); + } catch (e) { + throw new Error(`LLM response not JSON: ${responseText.slice(0, 300)}`); + } const content = parsed.choices?.[0]?.message?.content; if (!content) return null;