pub trait TokenCounter: WasmCompatSend + WasmCompatSync {
// Required method
fn count(&self, message: &Message) -> usize;
}Expand description
Counts the tokens contributed by a single Message.
Implementors should pick a counting strategy appropriate for their target
provider (for example, tiktoken-rs for OpenAI). Counting must be cheap;
it runs once per message on every memory load.