pub struct CostRecord {
pub provider: Option<String>,
pub model: String,
pub prompt_tokens: usize,
pub completion_tokens: usize,
pub cost_usd: f64,
}Expand description
One priced LLM call.
Fields§
§provider: Option<String>Provider slug ("openai", "anthropic", …); None when the caller
did not declare one.
model: StringModel id as reported by the model.
prompt_tokens: usizePrompt tokens of the call.
completion_tokens: usizeCompletion tokens of the call.
cost_usd: f64Priced USD cost (0.0 when the table has no entry).
Trait Implementations§
Source§impl Clone for CostRecord
impl Clone for CostRecord
Source§fn clone(&self) -> CostRecord
fn clone(&self) -> CostRecord
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 Debug for CostRecord
impl Debug 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
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