pub trait Tokenizer: Send + Sync {
// Required method
fn count_tokens(&self, text: &str) -> usize;
}Expand description
Token counter abstraction
Required Methods§
Sourcefn count_tokens(&self, text: &str) -> usize
fn count_tokens(&self, text: &str) -> usize
Estimate how many model tokens the input text will consume.