pub struct CostRecord {
pub tokens_in: u64,
pub tokens_out: u64,
pub usd: Decimal,
pub wall_ms: u64,
pub tool_ms: u64,
}Expand description
What a step cost.
Fields§
§tokens_in: u64Prompt tokens consumed.
tokens_out: u64Completion tokens produced.
usd: DecimalMonetary cost.
A decimal, never a float: money that does not add up exactly is worse than no figure at all.
wall_ms: u64Wall-clock time in milliseconds, including waiting.
tool_ms: u64Time spent inside tools, in milliseconds.
Implementations§
Source§impl CostRecord
impl CostRecord
Sourcepub fn total_tokens(&self) -> u64
pub fn total_tokens(&self) -> u64
Total tokens, in and out.
Trait Implementations§
Source§impl Clone for CostRecord
impl Clone for CostRecord
Source§impl Debug for CostRecord
impl Debug for CostRecord
Source§impl Default for CostRecord
impl Default for CostRecord
Source§impl<'de> Deserialize<'de> for CostRecord
impl<'de> Deserialize<'de> for CostRecord
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 Eq for CostRecord
Source§impl PartialEq for CostRecord
impl PartialEq for CostRecord
Source§impl Serialize for CostRecord
impl Serialize for CostRecord
impl StructuralPartialEq for CostRecord
Auto Trait Implementations§
impl Freeze for CostRecord
impl RefUnwindSafe for CostRecord
impl Send for CostRecord
impl Sync for CostRecord
impl Unpin for CostRecord
impl UnsafeUnpin for CostRecord
impl UnwindSafe for CostRecord
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
Source§impl<T> Canonical for T
impl<T> Canonical for T
Source§fn canonical_bytes(&self) -> Result<Vec<u8>, CanonicalError>
fn canonical_bytes(&self) -> Result<Vec<u8>, CanonicalError>
The canonical CBOR encoding of this value.