pub struct ChatUsage {Show 16 fields
pub chat: String,
pub context_used: u64,
pub estimated: bool,
pub context_window: u64,
pub compact_at: u64,
pub last_prompt_tokens: u64,
pub last_completion_tokens: u64,
pub prompt_tokens: u64,
pub completion_tokens: u64,
pub model_calls: u64,
pub compactions: u64,
pub elapsed_ms: u64,
pub compacting: bool,
pub agent_prompt_tokens: u64,
pub agent_completion_tokens: u64,
pub agent_calls: u64,
}Expand description
Token use of one chat, for the header meter.
Fields§
§chat: String§context_used: u64Tokens the conversation takes in the context now (the last request’s prompt and reply as the server counted them, or an estimate of the next request).
estimated: boolcontext_used is the engine’s estimate, not the server’s count.
context_window: u64The context window in tokens (a default when the server doesn’t say).
compact_at: u64Requests bigger than this are compacted first (0: never automatically).
last_prompt_tokens: u64Prompt and completion tokens of the most recent model request.
last_completion_tokens: u64§prompt_tokens: u64Totals over the whole chat, as reported by the server.
completion_tokens: u64§model_calls: u64Model requests, tool rounds and compactions included.
compactions: u64§elapsed_ms: u64Time spent in replies and compactions.
compacting: boolA compaction is running in this chat.
agent_prompt_tokens: u64Tokens subagents used (not in the chat’s context; not in the totals above).
agent_completion_tokens: u64§agent_calls: u64Model requests subagents made.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChatUsage
impl<'de> Deserialize<'de> for ChatUsage
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 ChatUsage
impl StructuralPartialEq for ChatUsage
Auto Trait Implementations§
impl Forget for ChatUsage
impl Freeze for ChatUsage
impl Move for ChatUsage
impl RefUnwindSafe for ChatUsage
impl Send for ChatUsage
impl Sync for ChatUsage
impl Unpin for ChatUsage
impl UnsafeUnpin for ChatUsage
impl UnwindSafe for ChatUsage
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