pub struct CompactionMeta {
pub tail_start_id: Option<Uuid>,
pub previous_compaction_id: Option<Uuid>,
pub summary_text: Option<String>,
}Expand description
Metadata attached to compaction-related messages.
Compaction produces two messages:
- A user message with
is_compaction = trueandcompaction_meta.tail_start_idindicating where the retained tail begins. - An assistant message with
is_summary = truecontaining the LLM-generated summary.
The previous_compaction_id and summary_text fields enable incremental
summarization: prior compaction summaries are fed back to the compaction LLM
so it can update the summary instead of regenerating from scratch.
Fields§
§tail_start_id: Option<Uuid>The first message ID retained in the tail after this compaction.
previous_compaction_id: Option<Uuid>The message ID of the previous compaction user message, enabling incremental updates.
summary_text: Option<String>The summary text generated by the compaction LLM (stored for reuse).
Implementations§
Source§impl CompactionMeta
impl CompactionMeta
Sourcepub fn new(tail_start_id: Uuid) -> Self
pub fn new(tail_start_id: Uuid) -> Self
Creates compaction metadata for a new compaction user message.
Sets tail_start_id to the given ID; previous_compaction_id
and summary_text are left as None.
Sourcepub fn with_previous(self, previous_id: Uuid) -> Self
pub fn with_previous(self, previous_id: Uuid) -> Self
Sets the previous compaction ID for incremental summarization, consuming and returning self.
Sourcepub fn with_summary(self, summary: String) -> Self
pub fn with_summary(self, summary: String) -> Self
Sets the summary text, consuming and returning self.
Trait Implementations§
Source§impl Clone for CompactionMeta
impl Clone for CompactionMeta
Source§fn clone(&self) -> CompactionMeta
fn clone(&self) -> CompactionMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompactionMeta
impl Debug for CompactionMeta
Source§impl<'de> Deserialize<'de> for CompactionMeta
impl<'de> Deserialize<'de> for CompactionMeta
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>,
Source§impl PartialEq for CompactionMeta
impl PartialEq for CompactionMeta
Source§fn eq(&self, other: &CompactionMeta) -> bool
fn eq(&self, other: &CompactionMeta) -> bool
self and other values to be equal, and is used by ==.