pub struct UsageInfo {
pub prompt_tokens: u64,
pub completion_tokens: u64,
pub total_tokens: u64,
pub reasoning_tokens: Option<u64>,
pub cache_read_tokens: Option<u64>,
pub cache_creation_tokens: Option<u64>,
}Expand description
Token usage information.
Fields§
§prompt_tokens: u64§completion_tokens: u64§total_tokens: u64§reasoning_tokens: Option<u64>OpenAI-style completion_tokens_details.reasoning_tokens.
cache_read_tokens: Option<u64>Anthropic cache read / creation input tokens (when present).
cache_creation_tokens: Option<u64>Trait Implementations§
Source§impl From<UsageInfo> for ExecutionUsage
impl From<UsageInfo> for ExecutionUsage
Source§fn from(u: UsageInfo) -> ExecutionUsage
fn from(u: UsageInfo) -> ExecutionUsage
Converts to this type from the input type.
Source§impl Serialize for UsageInfo
impl Serialize for UsageInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for UsageInfo
impl RefUnwindSafe for UsageInfo
impl Send for UsageInfo
impl Sync for UsageInfo
impl Unpin for UsageInfo
impl UnsafeUnpin for UsageInfo
impl UnwindSafe for UsageInfo
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