pub struct InteractionUsage {
pub total_input_tokens: Option<u64>,
pub total_output_tokens: Option<u64>,
pub total_tokens: Option<u64>,
}Expand description
Token usage metadata for an interaction.
Fields§
§total_input_tokens: Option<u64>§total_output_tokens: Option<u64>§total_tokens: Option<u64>Trait Implementations§
Source§impl Clone for InteractionUsage
impl Clone for InteractionUsage
Source§fn clone(&self) -> InteractionUsage
fn clone(&self) -> InteractionUsage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 InteractionUsage
impl Debug for InteractionUsage
Source§impl Default for InteractionUsage
impl Default for InteractionUsage
Source§fn default() -> InteractionUsage
fn default() -> InteractionUsage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InteractionUsage
impl<'de> Deserialize<'de> for InteractionUsage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractionUsage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractionUsage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl GetTokenUsage for InteractionUsage
impl GetTokenUsage for InteractionUsage
Source§fn token_usage(&self) -> Usage
fn token_usage(&self) -> Usage
Returns token usage for this response. Zero-valued usage is
Usage’s documented sentinel for missing provider usage metrics;
response types that carry no usage return Usage::new.Source§impl Serialize for InteractionUsage
impl Serialize for InteractionUsage
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 InteractionUsage
impl RefUnwindSafe for InteractionUsage
impl Send for InteractionUsage
impl Sync for InteractionUsage
impl Unpin for InteractionUsage
impl UnsafeUnpin for InteractionUsage
impl UnwindSafe for InteractionUsage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
impl<T> DebuggableStorage for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.