Spaces:
Paused
Paused
Fix syntax error in backend
Browse files- 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 = {}) {
|