pub struct Compactor { /* private fields */ }Expand description
Compacts context by generating an LLM summary
Implementations§
Source§impl Compactor
impl Compactor
pub fn new(llm: Arc<dyn StreamingModelProvider>) -> Self
Sourcepub async fn compact(
&self,
context: Context,
) -> Result<CompactionResult, CompactionError>
pub async fn compact( &self, context: Context, ) -> Result<CompactionResult, CompactionError>
Generate a structured summary of the conversation.
Takes the context snapshot by value since the caller applies the summary
to its live context (which may have changed while the summarization
request was in flight) via Context::with_compacted_summary.
Auto Trait Implementations§
impl !RefUnwindSafe for Compactor
impl !UnwindSafe for Compactor
impl Freeze for Compactor
impl Send for Compactor
impl Sync for Compactor
impl Unpin for Compactor
impl UnsafeUnpin for Compactor
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