pub struct CompactionConfig { /* private fields */ }Expand description
Runtime-owned policy for checkpoint compaction.
enabled, policy, and trigger_threshold_percent drive automatic compaction before
a provider request. Manual crate::Runtime::compact_context calls default to this
configured policy (and accept a per-call override), while
crate::Runtime::compact_context_once always requires an explicit
CitationCompactionPolicy.
reasoning_effort and prompt are not path-specific: they apply to every compaction
request, automatic or manual, which is why this type is named for compaction
rather than for one of its callers.
Compaction is a summarization turn over the whole covered window, so it never
inherits the primary model’s reasoning effort: a primary tuned for hard
coding turns can spend its entire output budget reasoning about history and
never write the checkpoint. None leaves the provider default in place.
Implementations§
Source§impl CompactionConfig
impl CompactionConfig
Sourcepub fn enabled(policy: CitationCompactionPolicy) -> Self
pub fn enabled(policy: CitationCompactionPolicy) -> Self
Enables automatic compaction with the provided policy.
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Disables automatic compaction.
The policy remains populated with defaults so disabled configs can be inspected or re-enabled by callers without constructing a dummy policy.
pub const fn is_enabled(&self) -> bool
pub const fn policy(&self) -> CitationCompactionPolicy
Sourcepub const fn with_policy(self, policy: CitationCompactionPolicy) -> Self
pub const fn with_policy(self, policy: CitationCompactionPolicy) -> Self
Replaces the summary acceptance and retention policy.
Sourcepub fn with_reasoning_effort(
self,
reasoning_effort: Option<ReasoningEffort>,
) -> Self
pub fn with_reasoning_effort( self, reasoning_effort: Option<ReasoningEffort>, ) -> Self
Returns a copy configured with a reasoning-effort level for compaction.
Sourcepub fn reasoning_effort(&self) -> Option<&ReasoningEffort>
pub fn reasoning_effort(&self) -> Option<&ReasoningEffort>
Optional reasoning-effort level for compaction model requests.
Sourcepub fn with_trigger_threshold_percent(
self,
percent: u8,
) -> Result<Self, CompactionError>
pub fn with_trigger_threshold_percent( self, percent: u8, ) -> Result<Self, CompactionError>
Sets the dynamic-body usage percentage (1..=100) that triggers automatic compaction.
Defaults to AUTO_COMPACT_THRESHOLD_PERCENT (85).
Sourcepub const fn trigger_threshold_percent(&self) -> u8
pub const fn trigger_threshold_percent(&self) -> u8
Dynamic-body usage percentage (1..=100) that triggers automatic compaction.
Sourcepub fn with_prompt(self, prompt: CompactionPrompt) -> Self
pub fn with_prompt(self, prompt: CompactionPrompt) -> Self
Sets the prompt configuration applied to both automatic and manual compaction requests.
Sourcepub fn prompt(&self) -> &CompactionPrompt
pub fn prompt(&self) -> &CompactionPrompt
Prompt configuration applied to automatic and manual compaction requests.
Trait Implementations§
Source§impl Clone for CompactionConfig
impl Clone for CompactionConfig
Source§impl Debug for CompactionConfig
impl Debug for CompactionConfig
Source§impl Default for CompactionConfig
impl Default for CompactionConfig
impl Eq for CompactionConfig
Source§impl PartialEq for CompactionConfig
impl PartialEq for CompactionConfig
impl StructuralPartialEq for CompactionConfig
Auto Trait Implementations§
impl Forget for CompactionConfig
impl Freeze for CompactionConfig
impl Move for CompactionConfig
impl RefUnwindSafe for CompactionConfig
impl Send for CompactionConfigwhere
RawVecInner: Send,
impl Sync for CompactionConfigwhere
RawVecInner: Sync,
impl Unpin for CompactionConfig
impl UnsafeUnpin for CompactionConfig
impl UnwindSafe for CompactionConfigwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.