pub struct CompactedContext {
pub tokens_before: u64,
pub tokens_after: u64,
pub tokens_saved: u64,
}Expand description
Context for LoopObserver::on_compaction.
Reports the estimated token counts before and after compaction and the number of tokens saved.
Fields§
§tokens_before: u64Estimated token count before compaction.
The token count of the conversation before the compactor ran,
reconstructed from tokens_after + tokens_saved.
tokens_after: u64Estimated token count after compaction.
The token count of the compacted conversation that will be used for subsequent model calls.
tokens_saved: u64Estimated tokens saved by compaction.
tokens_before - tokens_after, the net reduction achieved by
the compactor.
Trait Implementations§
Source§impl Clone for CompactedContext
impl Clone for CompactedContext
Source§fn clone(&self) -> CompactedContext
fn clone(&self) -> CompactedContext
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 moreAuto Trait Implementations§
impl Freeze for CompactedContext
impl RefUnwindSafe for CompactedContext
impl Send for CompactedContext
impl Sync for CompactedContext
impl Unpin for CompactedContext
impl UnsafeUnpin for CompactedContext
impl UnwindSafe for CompactedContext
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