pub struct Cost {
pub input: f64,
pub output: f64,
pub cache_read: f64,
pub cache_write: f64,
pub total: f64,
}Expand description
费用明细(单位:美元)。
按 token 类别拆分,total 为各项之和。
仅在上层持有定价表时可计算,因此 Usage 中为 Option<Cost>。
Fields§
§input: f64输入 token 费用
output: f64输出 token 费用
cache_read: f64缓存读取 token 费用
cache_write: f64缓存写入 token 费用
total: f64总费用(各项之和)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cost
impl<'de> Deserialize<'de> for Cost
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 StructuralPartialEq for Cost
Auto Trait Implementations§
impl Freeze for Cost
impl RefUnwindSafe for Cost
impl Send for Cost
impl Sync for Cost
impl Unpin for Cost
impl UnsafeUnpin for Cost
impl UnwindSafe for Cost
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