mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fix(llm-parse): tolerate non-strict JSON from Gemini and similar models
Gemini reached through the OpenAI-compatible endpoint returns JavaScript-object-literal output — single-quoted strings, unquoted keys, trailing commas — which strict JSON.parse rejects. The reservation list then came back empty and the booking-import UI showed nothing (#1638). Add a shared parseLenientJson() that tries strict JSON first and falls back to JSON5 (which accepts exactly that relaxed superset), and route both the OpenAI-compatible and Ollama-native parse paths through it, replacing the two identical strict parsers.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
"fast-xml-parser": "^5.5.10",
|
||||
"helmet": "^8.1.0",
|
||||
"jimp": "^1.6.1",
|
||||
"json5": "^2.2.3",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"node-cron": "^4.2.1",
|
||||
"nodemailer": "^9.0.1",
|
||||
|
||||
Reference in New Issue
Block a user