Skip to main content

parse_json_with_trace

Function parse_json_with_trace 

Source
pub fn parse_json_with_trace<T: DeserializeOwned>(
    response: &str,
    opts: &ParseOptions,
) -> Result<(T, ParseTrace), ParseError>
Expand description

Parse an LLM response into a typed struct, returning a diagnostic trace.

Identical to parse_json but accepts ParseOptions for safety limits and returns ParseTrace recording which strategies were attempted.

ยงErrors

Returns ParseError::TooLarge if input exceeds opts.max_input_bytes, ParseError::TooDeep if JSON nesting exceeds opts.max_nesting_depth.