Skip to main content

extract_json_from_output

Function extract_json_from_output 

Source
pub fn extract_json_from_output(output: &str) -> Option<Value>
Expand description

Extract JSON from agent output text.

Tries multiple strategies:

  1. Look for ```json code blocks
  2. Look for bare ``` code blocks that contain JSON
  3. Try parsing the entire output as JSON
  4. Find JSON object/array patterns in the text