Skip to main content

validate

Function validate 

Source
pub fn validate(messages: &[impl Borrow<Message>]) -> Result<(), PairingError>
Expand description

Rejects what pair would repair: consecutive assistant messages, a call nothing answered, and a result no waiting call asked for.

Call ids are matched as a multiset in call order, so a turn that repeats an id is answered by one result per occurrence. A turn that ended in an error or was aborted owes no results. A turn’s results may be split over adjacent user messages or around system messages, which reset the consecutive-assistant check but keep calls waiting.