Skip to main content

parse_and_fix

Function parse_and_fix 

Source
pub fn parse_and_fix(payload: &str) -> Result<Vec<Value>>
Expand description

Parses a raw A2UI block, repairing the model’s usual JSON slips.

Always returns a list: a lone object is wrapped, since an A2UI payload is a list of messages.

§Errors

Returns Error::Parse when the content is not JSON even after repair.