all tools

This commit is contained in:
leookun
2026-08-16 17:29:29 +08:00
parent eafede22e3
commit 4db2061611
95 changed files with 19023 additions and 5637 deletions
+22
View File
@@ -0,0 +1,22 @@
use std::ops::AddAssign;
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
pub struct Usage {
pub input_tokens: u64,
pub output_tokens: u64,
pub cache_read_tokens: u64,
pub cache_write_tokens: u64,
pub reasoning_tokens: u64,
}
impl AddAssign for Usage {
fn add_assign(&mut self, rhs: Self) {
self.input_tokens += rhs.input_tokens;
self.output_tokens += rhs.output_tokens;
self.cache_read_tokens += rhs.cache_read_tokens;
self.cache_write_tokens += rhs.cache_write_tokens;
self.reasoning_tokens += rhs.reasoning_tokens;
}
}