pub struct Usage {
pub prompt_tokens: i32,
pub completion_tokens: i32,
pub total_tokens: i32,
pub prompt_tokens_details: PromptUsageDetail,
pub completion_tokens_details: CompletionUsageDetail,
pub num_sources_used: i32,
}Expand description
Token usage information for chat completions.
Fields§
§prompt_tokens: i32Total prompt token used.
completion_tokens: i32Total completion token used.
total_tokens: i32Total token used, the sum of prompt token and completion token amount.
prompt_tokens_details: PromptUsageDetailBreakdown of prompt token usage of different types.
completion_tokens_details: CompletionUsageDetailBreakdown of completion token usage of different types.
num_sources_used: i32Number of individual live search source used.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Usage
impl<'de> Deserialize<'de> for Usage
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
impl StructuralPartialEq for Usage
Auto Trait Implementations§
impl Freeze for Usage
impl RefUnwindSafe for Usage
impl Send for Usage
impl Sync for Usage
impl Unpin for Usage
impl UnwindSafe for Usage
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