Parse lenient JSON with optional schema-based coercion.
Handles incomplete/malformed JSON commonly produced by LLMs:
//
tru
fal
nul
When parameters schema is provided, also coerces double-stringified values: "42" → 42, "true" → true, "{...}" → {...} based on expected types.
parameters
"42"
42
"true"
true
"{...}"
{...}
Type validation is NOT performed - use ILlmFunction.validate.
Raw JSON string (potentially incomplete or malformed)
Optional
Optional LLM parameters schema for type coercion
Parse result with data on success, or partial data with errors
Parse lenient JSON with optional schema-based coercion.
Handles incomplete/malformed JSON commonly produced by LLMs:
//and multi-line)tru,fal,nul)When
parametersschema is provided, also coerces double-stringified values:"42"→42,"true"→true,"{...}"→{...}based on expected types.Type validation is NOT performed - use ILlmFunction.validate.