Skip to main content

parse_decision

Function parse_decision 

Source
pub fn parse_decision<T: DeserializeOwned>(text: &str) -> Option<T>
Expand description

Parse a JSON decision — a reply that decides something the operator would otherwise decide (a verdict, a completion, an unblock).

Unlike parse_report this accepts only JSON the model presented AS its answer: the whole trimmed reply, or the content of exactly one fenced block. The greedy first-{-to-last-} span is deliberately absent — it reads a JSON object the model quoted and explicitly disowned as the answer and discards the real verdict in the surrounding prose (H10a). More than one fenced block is the same ambiguity and fails closed; the caller’s None branch is the conservative default.