pub struct LLMCompactorConfig {
pub threshold: f64,
pub keep_recent_turns: usize,
pub summary_system_prompt: Option<String>,
pub max_summary_tokens: Option<i64>,
pub summary_timeout: Option<Duration>,
}Expand description
Configuration for LLM-based conversation compaction.
Fields§
§threshold: f64Context utilization ratio (0.0-1.0) that triggers compaction.
keep_recent_turns: usizeNumber of recent turns to preserve during compaction.
summary_system_prompt: Option<String>System prompt for summarization. Uses DEFAULT_SUMMARY_SYSTEM_PROMPT if None.
max_summary_tokens: Option<i64>Maximum tokens for summary response. Uses DEFAULT_MAX_SUMMARY_TOKENS if None.
summary_timeout: Option<Duration>Timeout for summarization call. Uses DEFAULT_SUMMARY_TIMEOUT if None.
Implementations§
Source§impl LLMCompactorConfig
impl LLMCompactorConfig
Sourcepub fn new(threshold: f64, keep_recent_turns: usize) -> Self
pub fn new(threshold: f64, keep_recent_turns: usize) -> Self
Creates a new LLM compactor config with default optional values.
Sourcepub fn validate(&self) -> Result<(), CompactorConfigError>
pub fn validate(&self) -> Result<(), CompactorConfigError>
Validates the configuration.
Sourcepub fn system_prompt(&self) -> &str
pub fn system_prompt(&self) -> &str
Returns the system prompt to use (config value or default).
Sourcepub fn max_tokens(&self) -> i64
pub fn max_tokens(&self) -> i64
Returns the max tokens to use (config value or default).
Trait Implementations§
Source§impl Clone for LLMCompactorConfig
impl Clone for LLMCompactorConfig
Source§fn clone(&self) -> LLMCompactorConfig
fn clone(&self) -> LLMCompactorConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 LLMCompactorConfig
impl Debug for LLMCompactorConfig
Auto Trait Implementations§
impl Freeze for LLMCompactorConfig
impl RefUnwindSafe for LLMCompactorConfig
impl Send for LLMCompactorConfig
impl Sync for LLMCompactorConfig
impl Unpin for LLMCompactorConfig
impl UnwindSafe for LLMCompactorConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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