pub struct Spend {
pub input_tokens: u64,
pub output_tokens: u64,
pub cache_creation_tokens: u64,
pub cache_read_tokens: u64,
}Expand description
What has been spent so far, as the provider reported it, kept apart by kind because each kind is priced differently.
Fields§
§input_tokens: u64§output_tokens: u64§cache_creation_tokens: u64Tokens written into the prompt cache, and tokens read back from it.
cache_read_tokens: u64Implementations§
Source§impl Spend
impl Spend
Sourcepub fn counted_tokens(&self) -> u64
pub fn counted_tokens(&self) -> u64
Input, cache writes and output: what every ceiling and quota of the engine counts. Cache reads are left out.
Sourcepub fn all_tokens(&self) -> u64
pub fn all_tokens(&self) -> u64
Every token the provider reported, cache reads included.
Trait Implementations§
impl Copy for Spend
Source§impl<'de> Deserialize<'de> for Spend
impl<'de> Deserialize<'de> for Spend
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 Spend
Source§impl JsonSchema for Spend
impl JsonSchema for Spend
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 moreimpl StructuralPartialEq for Spend
Auto Trait Implementations§
impl Forget for Spend
impl Freeze for Spend
impl Move for Spend
impl RefUnwindSafe for Spend
impl Send for Spend
impl Sync for Spend
impl Unpin for Spend
impl UnsafeUnpin for Spend
impl UnwindSafe for Spend
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