pub trait Tokenizer: Send + Sync {
// Required methods
fn count_tokens(&self, text: &str) -> Result<usize>;
fn get_model_info(&self) -> ModelInfo;
}Expand description
Trait for tokenizing text with a specific model
Required Methods§
Sourcefn count_tokens(&self, text: &str) -> Result<usize>
fn count_tokens(&self, text: &str) -> Result<usize>
Count the number of tokens in the given text
Sourcefn get_model_info(&self) -> ModelInfo
fn get_model_info(&self) -> ModelInfo
Get information about the model