#[non_exhaustive]pub struct CompactionSpend {
pub usage: Usage,
pub cost_usd: Option<f64>,
pub requests: u32,
}Expand description
What compaction’s model requests cost; see SessionStats::compaction
and Agent::compaction_spend.
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.usage: UsageProvider usage summed over the summarization requests. total_tokens
stays 0, as in SessionStats::usage.
cost_usd: Option<f64>Dollar cost of usage at the summarization model’s
rates, with the crate’s rule: None once any request with non-zero
usage could not be priced (a summarizer with cost: None), and when
nothing was priced. is_unpriced tells them
apart.
requests: u32Summarization requests that returned a response, accepted or not.
Implementations§
Source§impl CompactionSpend
impl CompactionSpend
Sourcepub fn is_unpriced(&self) -> bool
pub fn is_unpriced(&self) -> bool
Sourcepub fn merge(&mut self, other: &CompactionSpend)
pub fn merge(&mut self, other: &CompactionSpend)
Fold another bucket into this one — for a caller accumulating across
runs. Keeps cost_usd None once any part is
unpriced.
Trait Implementations§
Source§impl Clone for CompactionSpend
impl Clone for CompactionSpend
Source§impl Debug for CompactionSpend
impl Debug for CompactionSpend
Source§impl Default for CompactionSpend
impl Default for CompactionSpend
Source§impl<'de> Deserialize<'de> for CompactionSpend
impl<'de> Deserialize<'de> for CompactionSpend
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 CompactionSpend
impl PartialEq for CompactionSpend
Source§impl Serialize for CompactionSpend
impl Serialize for CompactionSpend
impl StructuralPartialEq for CompactionSpend
Auto Trait Implementations§
impl Freeze for CompactionSpend
impl RefUnwindSafe for CompactionSpend
impl Send for CompactionSpend
impl Sync for CompactionSpend
impl Unpin for CompactionSpend
impl UnsafeUnpin for CompactionSpend
impl UnwindSafe for CompactionSpend
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