mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-20 21:17:47 +08:00
all tools
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user