pub struct LlmUsage {
pub prompt_tokens: u64,
pub completion_tokens: u64,
pub total_tokens: u64,
pub cached_input_tokens: u64,
pub cache_creation_input_tokens: u64,
}Expand description
Usage info extracted from an LLM API response.
Fields§
§prompt_tokens: u64Number of prompt / input tokens.
completion_tokens: u64Number of completion / output tokens.
total_tokens: u64Total tokens used.
cached_input_tokens: u64Input tokens served from the provider’s prompt cache (cache hit).
cache_creation_input_tokens: u64Input tokens written to the provider’s prompt cache (cache creation).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LlmUsage
impl RefUnwindSafe for LlmUsage
impl Send for LlmUsage
impl Sync for LlmUsage
impl Unpin for LlmUsage
impl UnsafeUnpin for LlmUsage
impl UnwindSafe for LlmUsage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more