pub struct WindowBudget {
pub model_window_limit: usize,
pub compaction_trigger: usize,
}Expand description
Trigger thresholds for frame materialization, in estimated tokens. A pure
value: the trigger check reads only compaction_trigger; the full budget
rides along to the compaction implementation via CompactionInput.
Fields§
§model_window_limit: usizeUpper bound of the model’s context window, in estimated tokens. Consulted by compaction implementations, not by the trigger check.
compaction_trigger: usizeEstimated-token threshold at or above which WindowBudget::should_compact
fires. The default usize::MAX means “never trigger”.
Implementations§
Source§impl WindowBudget
impl WindowBudget
Sourcepub fn should_compact(&self, estimated_tokens: usize) -> bool
pub fn should_compact(&self, estimated_tokens: usize) -> bool
Whether frame materialization should compact: true when
estimated_tokens has reached the compaction_trigger.
Trait Implementations§
Source§impl Clone for WindowBudget
impl Clone for WindowBudget
Source§fn clone(&self) -> WindowBudget
fn clone(&self) -> WindowBudget
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 WindowBudget
Source§impl Debug for WindowBudget
impl Debug for WindowBudget
Source§impl Default for WindowBudget
impl Default for WindowBudget
Source§impl<'de> Deserialize<'de> for WindowBudget
impl<'de> Deserialize<'de> for WindowBudget
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 WindowBudget
Source§impl PartialEq for WindowBudget
impl PartialEq for WindowBudget
Source§impl Serialize for WindowBudget
impl Serialize for WindowBudget
impl StructuralPartialEq for WindowBudget
Auto Trait Implementations§
impl Freeze for WindowBudget
impl RefUnwindSafe for WindowBudget
impl Send for WindowBudget
impl Sync for WindowBudget
impl Unpin for WindowBudget
impl UnsafeUnpin for WindowBudget
impl UnwindSafe for WindowBudget
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