pub fn extract_json(raw: &str) -> Result<NormalizedOutput, NormalizationError>Expand description
Extract a JSON body from a raw LLM response.
Tries extraction strategies in order of specificity:
- Fenced JSON (
\``json`) - Generic fence (
\```) whose content parses as JSON - Direct JSON (trimmed input starts with
{or[) - Embedded JSON (first
{to last balanced})
Returns the extracted body and the method used, or an error if no JSON could be found.