UNPKG

ai-json-fixer

Version:

A simple JSON parser designed to handle malformed JSON from Large Language Models

24 lines 823 B
import { ParseOptions, ParseResult } from '../types'; /** * Main parser class for handling malformed JSON from Large Language Models */ export declare class LLMJSONParser { private defaultOptions; /** * Parse JSON input with automatic fixing of common LLM output issues */ parse<T = any>(input: string, options?: Partial<ParseOptions>): T | null; /** * Try to parse JSON input, returning detailed results including fixes and warnings */ tryParse<T = any>(input: string, options?: Partial<ParseOptions>): ParseResult<T>; /** * Apply fixes to the input based on options and mode */ private applyFixes; /** * Calculate confidence score based on number of fixes applied */ private calculateConfidence; } //# sourceMappingURL=llm-json-parser.d.ts.map