pub struct ContextUsage {
pub estimated_tokens: usize,
pub max_tokens: usize,
pub reserved_response_tokens: usize,
pub available_tokens: usize,
pub utilization: f32,
pub over_limit: bool,
}Expand description
Estimated context usage for a session.
Fields§
§estimated_tokens: usizeEstimated number of tokens consumed by the transcript.
max_tokens: usizeMaximum tokens configured for the session.
reserved_response_tokens: usizeTokens reserved for the next response.
available_tokens: usizeEstimated tokens available for prompts before hitting the limit.
utilization: f32Estimated utilization of the available budget (0.0 - 1.0+).
Measured against available_tokens (the window minus the reserved
response budget). over_limit uses the exact integer counts and is
false at the boundary where utilization is 1.0.
over_limit: boolWhether the estimate exceeds the available budget.
Trait Implementations§
Source§impl Clone for ContextUsage
impl Clone for ContextUsage
impl Copy for ContextUsage
Auto Trait Implementations§
impl Freeze for ContextUsage
impl RefUnwindSafe for ContextUsage
impl Send for ContextUsage
impl Sync for ContextUsage
impl Unpin for ContextUsage
impl UnsafeUnpin for ContextUsage
impl UnwindSafe for ContextUsage
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