Documentation
    Preparing search index...
    • Parse lenient JSON with optional schema-based coercion.

      Handles incomplete/malformed JSON commonly produced by LLMs:

      • Unclosed brackets, strings, trailing commas
      • JavaScript-style comments (// and multi-line)
      • Unquoted object keys, incomplete keywords (tru, fal, nul)
      • Markdown code block extraction, junk prefix skipping

      When parameters schema is provided, also coerces double-stringified values: "42"42, "true"true, "{...}"{...} based on expected types.

      Type validation is NOT performed - use ILlmFunction.validate.

      Type Parameters

      • T = unknown

      Parameters

      • input: string

        Raw JSON string (potentially incomplete or malformed)

      • Optionalparameters: ILlmSchema.IParameters

        Optional LLM parameters schema for type coercion

      Returns IJsonParseResult<T>

      Parse result with data on success, or partial data with errors