pub struct ContextStatus {
pub used_tokens: Option<u64>,
pub context_window: Option<u64>,
pub ratio: Option<f64>,
}Expand description
Snapshot of the session’s context usage, returned by Session::context_status.
Powers the /context slash command (and any client-side context gauge).
Fields§
§used_tokens: Option<u64>Estimated tokens currently held in history. None when no estimate is available
yet (e.g. an empty session before the first request).
context_window: Option<u64>The model’s context window in tokens, if the provider exposes it.
ratio: Option<f64>Fraction of the window in use (used / window), only when both are known.
Trait Implementations§
Source§impl Clone for ContextStatus
impl Clone for ContextStatus
Source§fn clone(&self) -> ContextStatus
fn clone(&self) -> ContextStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ContextStatus
Auto Trait Implementations§
impl Freeze for ContextStatus
impl RefUnwindSafe for ContextStatus
impl Send for ContextStatus
impl Sync for ContextStatus
impl Unpin for ContextStatus
impl UnsafeUnpin for ContextStatus
impl UnwindSafe for ContextStatus
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