pub fn token_split(messages: &[Message], keep_tokens: usize) -> usizeExpand description
Index at which the kept (verbatim) tail starts when keeping roughly the
last keep_tokens tokens. The tail always starts on a plain user message
(never between a tool call and its result) and keeps at least the last
such message. Returns 0 when there is nothing older to summarize.