#[non_exhaustive]pub struct ModelUsage {
pub calls: i64,
pub cost_usd: f64,
pub input_tokens: i64,
pub model: String,
pub output_tokens: i64,
}Expand description
One model’s contribution to a session in the API: how many llm calls ran on it and what they spent.
Models the contract’s ModelUsage schema.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.calls: i64The contract’s calls.
cost_usd: f64The contract’s cost_usd.
input_tokens: i64The contract’s input_tokens.
model: StringThe contract’s model.
output_tokens: i64The contract’s output_tokens.
Trait Implementations§
Source§impl Clone for ModelUsage
impl Clone for ModelUsage
Source§fn clone(&self) -> ModelUsage
fn clone(&self) -> ModelUsage
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 ContractModel for ModelUsage
impl ContractModel for ModelUsage
Source§impl Debug for ModelUsage
impl Debug for ModelUsage
Source§impl Default for ModelUsage
impl Default for ModelUsage
Source§fn default() -> ModelUsage
fn default() -> ModelUsage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModelUsagewhere
ModelUsage: Default,
impl<'de> Deserialize<'de> for ModelUsagewhere
ModelUsage: Default,
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 ModelUsage
impl PartialEq for ModelUsage
Source§impl Serialize for ModelUsage
impl Serialize for ModelUsage
impl StructuralPartialEq for ModelUsage
Auto Trait Implementations§
impl Freeze for ModelUsage
impl RefUnwindSafe for ModelUsage
impl Send for ModelUsage
impl Sync for ModelUsage
impl Unpin for ModelUsage
impl UnsafeUnpin for ModelUsage
impl UnwindSafe for ModelUsage
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