pub struct CompactionConfig {
pub provider: String,
pub model: String,
pub system_prompt: Option<String>,
pub user_prompt_template: Option<String>,
pub max_summary_tokens: usize,
pub temperature: f32,
}Expand description
Configuration for LLM-based compaction.
When a Compacting region hits its threshold, it sends content to an LLM for summarization. This config controls which LLM is used and how the summarization prompt is constructed.
Fields§
§provider: StringProvider to use for compaction (e.g., “anthropic”, “openai”)
model: StringModel to use (e.g., “claude-sonnet-4-6”, “gpt-5.4-mini”)
system_prompt: Option<String>Custom system prompt for compaction (None = use default)
user_prompt_template: Option<String>Custom user prompt template. Use {content} as placeholder for region content, {region_name} for the region name.
max_summary_tokens: usizeMax tokens for the summary response
temperature: f32Temperature (lower = more deterministic)
Implementations§
Source§impl CompactionConfig
impl CompactionConfig
Sourcepub fn system_prompt(&self) -> &str
pub fn system_prompt(&self) -> &str
Get the system prompt, using the default if none is configured.
Sourcepub fn user_prompt(&self, content: &str, region_name: &str) -> String
pub fn user_prompt(&self, content: &str, region_name: &str) -> String
Get the user prompt, substituting {content} and {region_name} placeholders.
Trait Implementations§
Source§impl Clone for CompactionConfig
impl Clone for CompactionConfig
Source§fn clone(&self) -> CompactionConfig
fn clone(&self) -> CompactionConfig
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 moreSource§impl Debug for CompactionConfig
impl Debug for CompactionConfig
Source§impl Default for CompactionConfig
impl Default for CompactionConfig
Source§impl<'de> Deserialize<'de> for CompactionConfig
impl<'de> Deserialize<'de> for CompactionConfig
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 Freeze for CompactionConfig
impl RefUnwindSafe for CompactionConfig
impl Send for CompactionConfig
impl Sync for CompactionConfig
impl Unpin for CompactionConfig
impl UnsafeUnpin for CompactionConfig
impl UnwindSafe for CompactionConfig
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