UNPKG

ludmi

Version:

LU (Layer Understanding) is a lightweight framework for controlled chatbot interactions with LLMs, action orchestration, and retrieval-augmented generation (RAG).

16 lines (15 loc) 424 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JSONparse = void 0; const JSONparse = (response) => { try { const JSONstring = response.replaceAll(/\`{3}(json)?/g, '').trim(); const json = JSON.parse(JSONstring); return json; } catch (err) { console.error(err); throw new Error('Invalid JSON'); } }; exports.JSONparse = JSONparse;