pub struct Usage {
pub total_tokens: Option<i64>,
pub input_tokens: Option<i64>,
pub output_tokens: Option<i64>,
pub input_token_details: Option<InputTokenDetails>,
pub output_token_details: Option<OutputTokenDetails>,
}Expand description
Usage statistics for the Response, this will correspond to billing. A Realtime API session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns.
Fields§
§total_tokens: Option<i64>The total number of tokens in the Response including input and output text and audio tokens.
input_tokens: Option<i64>The number of input tokens used in the Response, including text and audio tokens.
output_tokens: Option<i64>The number of output tokens sent in the Response, including text and audio tokens.
input_token_details: Option<InputTokenDetails>Details about the input tokens used in the Response.
output_token_details: Option<OutputTokenDetails>Details about the output tokens used in the Response.
Implementations§
Source§impl Usage
impl Usage
Sourcepub fn builder() -> UsageBuilder<((), (), (), (), ())>
pub fn builder() -> UsageBuilder<((), (), (), (), ())>
Create a builder for building Usage.
On the builder, call .total_tokens(...)(optional), .input_tokens(...)(optional), .output_tokens(...)(optional), .input_token_details(...)(optional), .output_token_details(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of Usage.