pub struct AgentCompactor<M: ModelAdapter + Clone + 'static> { /* private fields */ }Expand description
CompactionBackend that summarises items by running a nested loop over
a sub-agent.
Plug into any CompactionStrategy that needs a backend (e.g.
SummarizeOlderStrategy) via StrategyCompactorBuilder::backend.
Pair with whatever trigger fits — see context_window_trigger for a
token-aware default.
Implementations§
Source§impl<M: ModelAdapter + Clone + 'static> AgentCompactor<M>
impl<M: ModelAdapter + Clone + 'static> AgentCompactor<M>
Sourcepub fn builder() -> AgentCompactorBuilder<M>
pub fn builder() -> AgentCompactorBuilder<M>
Start a new builder. agent and session_id are required.
Trait Implementations§
Source§impl<M: ModelAdapter + Clone + 'static> CompactionBackend for AgentCompactor<M>
impl<M: ModelAdapter + Clone + 'static> CompactionBackend for AgentCompactor<M>
Source§fn summarize<'life0, 'async_trait>(
&'life0 self,
request: SummaryRequest,
cancellation: Option<TurnCancellation>,
) -> Pin<Box<dyn Future<Output = Result<SummaryResult, CompactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn summarize<'life0, 'async_trait>(
&'life0 self,
request: SummaryRequest,
cancellation: Option<TurnCancellation>,
) -> Pin<Box<dyn Future<Output = Result<SummaryResult, CompactionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Summarise the given items into a shorter set of replacement items. Read more
Auto Trait Implementations§
impl<M> Freeze for AgentCompactor<M>
impl<M> !RefUnwindSafe for AgentCompactor<M>
impl<M> Send for AgentCompactor<M>
impl<M> Sync for AgentCompactor<M>
impl<M> Unpin for AgentCompactor<M>
impl<M> UnsafeUnpin for AgentCompactor<M>
impl<M> !UnwindSafe for AgentCompactor<M>
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