Skip to main content

parse_json_lenient

Function parse_json_lenient 

Source
pub fn parse_json_lenient(text: &str) -> Option<Value>
Expand description

Best-effort parse of a model’s text into a JSON value: a direct parse first, else the substring between the first { and last } - tolerates markdown fences or surrounding prose a model adds around structured output.