Skip to main content

validate_tool_blocks

Function validate_tool_blocks 

Source
pub fn validate_tool_blocks(model: &str, blocks: &[Value]) -> Result<(), String>
Expand description

Validate one tool’s rich output before committing it to a tool_result. Callers can replace Err with a plain-text tool error; no offending bytes need enter history. The outgoing full-history check remains mandatory, since sibling tool results share one message count/broker/history budget.