Skip to main content

validate_canonical

Function validate_canonical 

Source
pub fn validate_canonical(messages: &[Message]) -> Result<(), TranscriptError>
Expand description

Rejects consecutive assistant messages, unanswered tool-call IDs, and results without a pending call. Each pending ID must be answered once in the next user message, before another assistant message or the end of history. System messages reset the consecutive-assistant check but retain pending calls. Duplicate call IDs are treated as one pending ID.