pub struct LlmCondenser { /* private fields */ }Expand description
Default Condenser implementation: summarizes a session’s tail via an LLM, reusing
zeph_context::summarization::summarize_structured. Distinct from live in-memory compaction
(owned by zeph-context) — this operates on the durable event log and is recorded as a
crate::event::SessionEvent::Condensation event so replay can fold the same summary
deterministically (spec §8, AC-6).
Implementations§
Source§impl LlmCondenser
impl LlmCondenser
Sourcepub fn new(deps: SummarizationDeps, threshold: f64, keep_recent: usize) -> Self
pub fn new(deps: SummarizationDeps, threshold: f64, keep_recent: usize) -> Self
Construct a new condenser with the given LLM dependencies, trigger threshold (fraction of
context budget used, 0.0..=1.0), and number of trailing messages to always keep.
Trait Implementations§
Source§impl Condenser for LlmCondenser
impl Condenser for LlmCondenser
Source§async fn should_condense(
&self,
state: &ReconstructedState,
budget_used_fraction: f64,
) -> bool
async fn should_condense( &self, state: &ReconstructedState, budget_used_fraction: f64, ) -> bool
Returns
true if the reconstructed context has grown enough (relative to
budget_used_fraction, the fraction of the context budget currently consumed) to warrant
a condensation pass.Source§async fn condense(
&self,
events: &[SessionEventEnvelope],
last_condensed_seq: u64,
) -> Result<CondensationResult, SessionError>
async fn condense( &self, events: &[SessionEventEnvelope], last_condensed_seq: u64, ) -> Result<CondensationResult, SessionError>
Condense
events (typically the tail since last_condensed_seq), producing a
CondensationResult whose replaced_range starts strictly after last_condensed_seq. Read moreAuto Trait Implementations§
impl !Freeze for LlmCondenser
impl !RefUnwindSafe for LlmCondenser
impl !UnwindSafe for LlmCondenser
impl Send for LlmCondenser
impl Sync for LlmCondenser
impl Unpin for LlmCondenser
impl UnsafeUnpin for LlmCondenser
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more