pub struct IntraCompactionConfig {
pub token_threshold: u64,
pub overlap_event_count: usize,
pub chars_per_token: u32,
}Expand description
Core traits and types.
Always available regardless of feature flags. Includes:
Agent- The fundamental trait for all agentsTool/Toolset- For extending agents with capabilitiesSession/State- For managing conversation contextEvent- For streaming agent responsesAdkError/Result- Unified error handling Configuration for intra-invocation context compaction.
When attached to a runner, the runner checks estimate_tokens() before each
LLM call and triggers summarization via BaseEventsSummarizer
when the estimated token count exceeds token_threshold.
§Example
use adk_core::IntraCompactionConfig;
let config = IntraCompactionConfig {
token_threshold: 50_000,
overlap_event_count: 5,
chars_per_token: 4,
};Fields§
§token_threshold: u64Token count threshold that triggers compaction.
overlap_event_count: usizeNumber of recent events to preserve after compaction for continuity.
chars_per_token: u32Characters-per-token ratio for estimation (default: 4).
Trait Implementations§
Source§impl Clone for IntraCompactionConfig
impl Clone for IntraCompactionConfig
Source§fn clone(&self) -> IntraCompactionConfig
fn clone(&self) -> IntraCompactionConfig
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 IntraCompactionConfig
impl Debug for IntraCompactionConfig
Source§impl Default for IntraCompactionConfig
impl Default for IntraCompactionConfig
Source§fn default() -> IntraCompactionConfig
fn default() -> IntraCompactionConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IntraCompactionConfig
impl RefUnwindSafe for IntraCompactionConfig
impl Send for IntraCompactionConfig
impl Sync for IntraCompactionConfig
impl Unpin for IntraCompactionConfig
impl UnsafeUnpin for IntraCompactionConfig
impl UnwindSafe for IntraCompactionConfig
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