pub struct UsageSnapshot {
pub prompt_tokens: u64,
pub completion_tokens: u64,
pub llm_calls: u64,
pub search_calls: u64,
pub fetch_calls: u64,
pub webbrowser_calls: u64,
pub custom_tool_calls: HashMap<String, u64>,
pub tool_calls: u64,
}Expand description
Snapshot of usage statistics.
Fields§
§prompt_tokens: u64Total LLM prompt tokens.
completion_tokens: u64Total LLM completion tokens.
llm_calls: u64Total LLM calls.
search_calls: u64Total search calls.
fetch_calls: u64Total HTTP fetch calls.
webbrowser_calls: u64Total web browser calls (Chrome/WebDriver combined).
custom_tool_calls: HashMap<String, u64>Custom tool calls by tool name.
tool_calls: u64Total tool calls.
Implementations§
Source§impl UsageSnapshot
impl UsageSnapshot
Sourcepub fn total_tokens(&self) -> u64
pub fn total_tokens(&self) -> u64
Get total tokens.
Sourcepub fn total_custom_tool_calls(&self) -> u64
pub fn total_custom_tool_calls(&self) -> u64
Get total custom tool calls across all tools.
Sourcepub fn get_custom_tool_calls(&self, tool_name: &str) -> u64
pub fn get_custom_tool_calls(&self, tool_name: &str) -> u64
Get call count for a specific custom tool.
Trait Implementations§
Source§impl Clone for UsageSnapshot
impl Clone for UsageSnapshot
Source§fn clone(&self) -> UsageSnapshot
fn clone(&self) -> UsageSnapshot
Returns a duplicate of the value. Read more
1.0.0 · 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 UsageSnapshot
impl Debug for UsageSnapshot
Source§impl Default for UsageSnapshot
impl Default for UsageSnapshot
Source§fn default() -> UsageSnapshot
fn default() -> UsageSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UsageSnapshot
impl<'de> Deserialize<'de> for UsageSnapshot
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
Auto Trait Implementations§
impl Freeze for UsageSnapshot
impl RefUnwindSafe for UsageSnapshot
impl Send for UsageSnapshot
impl Sync for UsageSnapshot
impl Unpin for UsageSnapshot
impl UnsafeUnpin for UsageSnapshot
impl UnwindSafe for UsageSnapshot
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