pub trait GetTokenUsage {
// Required method
fn token_usage(&self) -> Option<Usage>;
}Expand description
A trait for grabbing the token usage of a completion response.
Primarily designed for streamed completion responses in streamed multi-turn, as otherwise it would be impossible to do.
Required Methods§
fn token_usage(&self) -> Option<Usage>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".