pub trait TokenCounter {
// Required methods
fn count(&self, text: &str) -> usize;
fn unit(&self) -> &'static str;
}Expand description
Inject the selected model’s real tokenizer for token-denominated budgets. The built-in ByteCounter is deliberately BYTE-denominated, not chars/4.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".