pub struct ContextWindowMetrics {
pub usage_fraction: f32,
pub context_window: u32,
pub estimated_tokens: usize,
pub chars_per_token: f64,
pub system_block_count: usize,
pub recent_message_count: usize,
pub recent_system_message_count: usize,
pub has_handoff: bool,
pub has_staged_system_updates: bool,
pub prompt_cache_epoch: u32,
}Expand description
Metrics describing the currently assembled context window.
Fields§
§usage_fraction: f32Fraction of the calibrated context window currently in use.
context_window: u32Usable context window in tokens.
estimated_tokens: usizeEstimated prompt tokens currently held in the window.
chars_per_token: f64Characters per token, calibrated against the provider’s own counts.
system_block_count: usizeNumber of persistent system blocks in the stable prefix.
recent_message_count: usizeNumber of conversation messages.
recent_system_message_count: usizeNumber of durable system alerts that reassembly can prune.
has_handoff: boolWhether a handoff document is present.
has_staged_system_updates: boolWhether a system block rewrite is waiting for reassembly.
prompt_cache_epoch: u32How many times the cacheable prefix has been rewritten this session.
Trait Implementations§
Source§impl Clone for ContextWindowMetrics
impl Clone for ContextWindowMetrics
Source§impl Debug for ContextWindowMetrics
impl Debug for ContextWindowMetrics
Source§impl<'de> Deserialize<'de> for ContextWindowMetrics
impl<'de> Deserialize<'de> for ContextWindowMetrics
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
Auto Trait Implementations§
impl Forget for ContextWindowMetrics
impl Freeze for ContextWindowMetrics
impl Move for ContextWindowMetrics
impl RefUnwindSafe for ContextWindowMetrics
impl Send for ContextWindowMetrics
impl Sync for ContextWindowMetrics
impl Unpin for ContextWindowMetrics
impl UnsafeUnpin for ContextWindowMetrics
impl UnwindSafe for ContextWindowMetrics
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