pub struct CostBreakdown {
pub input: f64,
pub cache_write_5m: f64,
pub cache_write_1h: f64,
pub cache_read: f64,
pub output: f64,
pub web_search: f64,
}Expand description
USD by kind of token, accumulated message by message at each message’s
own model price, so a session that changed model part way is still exact.
The lines sum to Agent::cost_usd.
Fields§
§input: f64§cache_write_5m: f64§cache_write_1h: f64§cache_read: f64§output: f64§web_search: f64Server-side web searches, billed per search on top of the tokens.
Implementations§
Source§impl CostBreakdown
impl CostBreakdown
pub fn total(&self) -> f64
pub fn add(&mut self, o: &CostBreakdown)
pub fn sub(&mut self, o: &CostBreakdown)
Trait Implementations§
Source§impl Clone for CostBreakdown
impl Clone for CostBreakdown
Source§fn clone(&self) -> CostBreakdown
fn clone(&self) -> CostBreakdown
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 moreimpl Copy for CostBreakdown
Source§impl Debug for CostBreakdown
impl Debug for CostBreakdown
Source§impl Default for CostBreakdown
impl Default for CostBreakdown
Source§fn default() -> CostBreakdown
fn default() -> CostBreakdown
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CostBreakdown
impl<'de> Deserialize<'de> for CostBreakdown
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 CostBreakdown
impl PartialEq for CostBreakdown
Source§impl Serialize for CostBreakdown
impl Serialize for CostBreakdown
impl StructuralPartialEq for CostBreakdown
Auto Trait Implementations§
impl Freeze for CostBreakdown
impl RefUnwindSafe for CostBreakdown
impl Send for CostBreakdown
impl Sync for CostBreakdown
impl Unpin for CostBreakdown
impl UnsafeUnpin for CostBreakdown
impl UnwindSafe for CostBreakdown
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