Package Exports
- llm-json-guard
- llm-json-guard/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (llm-json-guard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
llm-json-guard
Production-safe JSON repair and schema validation for LLM outputs.
Installation
npm install llm-json-guard
Usage
import { LLMJsonGuard } from "llm-json-guard";
const guard = new LLMJsonGuard({ apiKey: process.env.RAPIDAPI_KEY });
const result = await guard.guard( "{name: 'Harsh', age: 21,}", { type: "object", properties: { name: { type: "string" }, age: { type: "number" } }, required: ["name", "age"] } );
console.log(result.data);
Requires a RapidAPI key. Get one here: https://rapidapi.com/...