pub struct EconomicsModelTotal {
pub model: String,
pub input_tokens: u64,
pub cache_creation_input_tokens: u64,
pub cache_read_input_tokens: u64,
pub output_tokens: u64,
pub cost_microusd: Option<u64>,
}Expand description
A model’s usage over a whole session, as the harness totalled it (modelUsage),
including models the harness called on its own account.
use majordomus_cli::economics::model::EconomicsModelTotal;
let t: EconomicsModelTotal = serde_json::from_value(serde_json::json!({
"model": "claude-haiku-5", "input_tokens": 900, "cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0, "output_tokens": 60, "cost_microusd": 1250
}))
.unwrap();
assert_eq!(t.cost_microusd, Some(1250), "0.00125 USD, kept as an integer");Fields§
§model: StringThe model.
input_tokens: u64inputTokens.
cache_creation_input_tokens: u64cacheCreationInputTokens.
cache_read_input_tokens: u64cacheReadInputTokens.
output_tokens: u64outputTokens.
cost_microusd: Option<u64>costUSD, in millionths of a dollar: the harness’s own projection from its price
table at run time, not a bill.
Trait Implementations§
Source§impl Clone for EconomicsModelTotal
impl Clone for EconomicsModelTotal
Source§fn clone(&self) -> EconomicsModelTotal
fn clone(&self) -> EconomicsModelTotal
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 EconomicsModelTotal
impl Debug for EconomicsModelTotal
Source§impl<'de> Deserialize<'de> for EconomicsModelTotal
impl<'de> Deserialize<'de> for EconomicsModelTotal
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 EconomicsModelTotal
Source§impl JsonSchema for EconomicsModelTotal
impl JsonSchema for EconomicsModelTotal
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ordered for EconomicsModelTotal
A model’s totals order by the model’s name, which the provider reports once per run.
impl Ordered for EconomicsModelTotal
A model’s totals order by the model’s name, which the provider reports once per run.
Source§impl PartialEq for EconomicsModelTotal
impl PartialEq for EconomicsModelTotal
Source§fn eq(&self, other: &EconomicsModelTotal) -> bool
fn eq(&self, other: &EconomicsModelTotal) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EconomicsModelTotal
impl Serialize for EconomicsModelTotal
impl StructuralPartialEq for EconomicsModelTotal
Auto Trait Implementations§
impl Freeze for EconomicsModelTotal
impl RefUnwindSafe for EconomicsModelTotal
impl Send for EconomicsModelTotal
impl Sync for EconomicsModelTotal
impl Unpin for EconomicsModelTotal
impl UnsafeUnpin for EconomicsModelTotal
impl UnwindSafe for EconomicsModelTotal
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.