UNPKG

llmverify

Version:

AI Output Verification Toolkit — Local-first LLM safety, hallucination detection, PII redaction, prompt injection defense, and runtime monitoring. Zero telemetry. OWASP LLM Top 10 aligned.

29 lines (28 loc) 789 B
/** * JSON Detection and Repair Module * * Detects JSON in text and attempts to repair malformed JSON. * * @module engines/classification/json-repair * @author Haiec * @license MIT */ import { JsonRepairStep } from './types'; /** * Result of JSON detection and repair. */ export interface JsonDetectionResult { isJson: boolean; normalizedJson?: unknown; candidate: string | null; repairSteps: JsonRepairStep[]; repairSucceeded: boolean; } /** * Detects and repairs JSON in text. * * @param text - The text to analyze * @param maxRepairSteps - Maximum repair steps to attempt (default: 6) * @returns JSON detection result with repair information */ export declare function detectAndRepairJson(text: string, maxRepairSteps?: number): JsonDetectionResult;