pub trait TokenCountExt {
// Required methods
fn token_count(&self, model: ModelType) -> TokenInfo;
fn token_counts(&self) -> HashMap<ModelType, TokenInfo>;
}Expand description
Extension trait for adding token counting to dx format serializer
Required Methods§
Sourcefn token_count(&self, model: ModelType) -> TokenInfo
fn token_count(&self, model: ModelType) -> TokenInfo
Get token count for the serialized output
Sourcefn token_counts(&self) -> HashMap<ModelType, TokenInfo>
fn token_counts(&self) -> HashMap<ModelType, TokenInfo>
Get token counts for all models
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".