pub struct CompactConfig {
pub enabled: bool,
pub token_threshold: usize,
pub keep_recent: usize,
pub micro_compact_exempt_tools: Vec<String>,
}Expand description
Context compact 配置
Fields§
§enabled: bool是否启用 context compact
token_threshold: usize触发 auto_compact 的 token 阈值
keep_recent: usizemicro_compact 保留最近几个 tool result 不替换
micro_compact_exempt_tools: Vec<String>micro_compact 中不压缩的工具名称列表(用户可扩展,与内置 EXEMPT_TOOLS 合并)
Implementations§
Source§impl CompactConfig
impl CompactConfig
Sourcepub fn effective_token_threshold(&self) -> usize
pub fn effective_token_threshold(&self) -> usize
返回有效的压缩阈值;若用户未设置(=0)则使用编译期默认值。
Trait Implementations§
Source§impl Clone for CompactConfig
impl Clone for CompactConfig
Source§fn clone(&self) -> CompactConfig
fn clone(&self) -> CompactConfig
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 CompactConfig
impl Debug for CompactConfig
Source§impl Default for CompactConfig
impl Default for CompactConfig
Source§impl<'de> Deserialize<'de> for CompactConfig
impl<'de> Deserialize<'de> for CompactConfig
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 CompactConfig
impl RefUnwindSafe for CompactConfig
impl Send for CompactConfig
impl Sync for CompactConfig
impl Unpin for CompactConfig
impl UnsafeUnpin for CompactConfig
impl UnwindSafe for CompactConfig
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.