Luca448 commited on
Commit
df148f0
·
1 Parent(s): 90fdb53

Fix syntax error in backend

Browse files
Files changed (1) hide show
  1. server/news-service.js +5 -0
server/news-service.js CHANGED
@@ -386,6 +386,11 @@ Antworte EXAKT als JSON:
386
 
387
  const rawResponse = await callGemini(prompt, apiKey, {
388
  temperature: 0.1, responseMimeType: 'application/json'
 
 
 
 
 
389
  let isGeneratingBackend = false;
390
 
391
  async function runGenerationCycle(options = {}) {
 
386
 
387
  const rawResponse = await callGemini(prompt, apiKey, {
388
  temperature: 0.1, responseMimeType: 'application/json'
389
+ });
390
+ const cleaned = rawResponse.replace(/```json\n?|```\n?/g, '').trim();
391
+ return JSON.parse(cleaned);
392
+ }
393
+
394
  let isGeneratingBackend = false;
395
 
396
  async function runGenerationCycle(options = {}) {