pub struct UsageStats {
pub prompt_tokens: usize,
pub completion_tokens: usize,
pub total_tokens: usize,
}Expand description
Token usage statistics for a single request or an entire session.
Fields§
§prompt_tokens: usizeNumber of tokens in the prompt.
completion_tokens: usizeNumber of tokens generated by the model.
total_tokens: usizeTotal tokens used (prompt + completion).
Trait Implementations§
Source§impl AddAssign for UsageStats
impl AddAssign for UsageStats
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Clone for UsageStats
impl Clone for UsageStats
Source§fn clone(&self) -> UsageStats
fn clone(&self) -> UsageStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UsageStats
impl Debug for UsageStats
Source§impl Default for UsageStats
impl Default for UsageStats
Source§fn default() -> UsageStats
fn default() -> UsageStats
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UsageStats
impl<'de> Deserialize<'de> for UsageStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Usage> for UsageStats
impl From<Usage> for UsageStats
Source§impl From<Usage> for UsageStats
impl From<Usage> for UsageStats
Source§impl From<UsageMetadata> for UsageStats
impl From<UsageMetadata> for UsageStats
Source§fn from(u: UsageMetadata) -> Self
fn from(u: UsageMetadata) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for UsageStats
impl RefUnwindSafe for UsageStats
impl Send for UsageStats
impl Sync for UsageStats
impl Unpin for UsageStats
impl UnsafeUnpin for UsageStats
impl UnwindSafe for UsageStats
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