pub struct RunUsage {
pub request_tokens: u64,
pub response_tokens: u64,
pub total_tokens: u64,
pub request_count: u32,
pub tool_call_count: u32,
pub cache_creation_tokens: Option<u64>,
pub cache_read_tokens: Option<u64>,
}Expand description
Usage tracking for a run.
Fields§
§request_tokens: u64Total request tokens.
response_tokens: u64Total response tokens.
total_tokens: u64Total tokens.
request_count: u32Number of model requests.
tool_call_count: u32Number of tool calls.
cache_creation_tokens: Option<u64>Cache creation tokens.
cache_read_tokens: Option<u64>Cache read tokens.
Implementations§
Source§impl RunUsage
impl RunUsage
Sourcepub fn add_request(&mut self, usage: RequestUsage)
pub fn add_request(&mut self, usage: RequestUsage)
Add usage from a model request.
Sourcepub fn record_tool_call(&mut self)
pub fn record_tool_call(&mut self)
Record a tool call.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RunUsage
impl RefUnwindSafe for RunUsage
impl Send for RunUsage
impl Sync for RunUsage
impl Unpin for RunUsage
impl UnwindSafe for RunUsage
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