pub struct CompletionTokensDetails {
pub accepted_prediction_tokens: Option<u32>,
pub audio_tokens: Option<u32>,
pub reasoning_tokens: Option<u32>,
pub rejected_prediction_tokens: Option<u32>,
}Available on crate feature
response-types only.Expand description
Breakdown of tokens used in a completion.
Fields§
§accepted_prediction_tokens: Option<u32>§audio_tokens: Option<u32>Audio input tokens generated by the model.
reasoning_tokens: Option<u32>Tokens generated by the model for reasoning.
rejected_prediction_tokens: Option<u32>When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.
Trait Implementations§
Source§impl Clone for CompletionTokensDetails
Available on (crate features chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.
impl Clone for CompletionTokensDetails
Available on (crate features
chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.Source§fn clone(&self) -> CompletionTokensDetails
fn clone(&self) -> CompletionTokensDetails
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 CompletionTokensDetails
Available on (crate features chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.
impl Debug for CompletionTokensDetails
Available on (crate features
chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.Source§impl Default for CompletionTokensDetails
Available on (crate features chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.
impl Default for CompletionTokensDetails
Available on (crate features
chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.Source§fn default() -> CompletionTokensDetails
fn default() -> CompletionTokensDetails
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CompletionTokensDetails
Available on (crate features chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.
impl<'de> Deserialize<'de> for CompletionTokensDetails
Available on (crate features
chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.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 PartialEq for CompletionTokensDetails
Available on (crate features chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.
impl PartialEq for CompletionTokensDetails
Available on (crate features
chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.Source§impl Serialize for CompletionTokensDetails
Available on (crate features chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.
impl Serialize for CompletionTokensDetails
Available on (crate features
chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.impl StructuralPartialEq for CompletionTokensDetails
Available on (crate features
chat-completion-types or response-types) and (crate features response-types or video-types or vectorstore-types or chat-completion-types or assistant-types or batch-types or audio-types or realtime-types or image-types) only.Auto Trait Implementations§
impl Freeze for CompletionTokensDetails
impl RefUnwindSafe for CompletionTokensDetails
impl Send for CompletionTokensDetails
impl Sync for CompletionTokensDetails
impl Unpin for CompletionTokensDetails
impl UnwindSafe for CompletionTokensDetails
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