pub struct AutoCompactor {
pub threshold: f64,
/* private fields */
}Fields§
§threshold: f64Implementations§
Source§impl AutoCompactor
impl AutoCompactor
pub fn new(threshold: f64) -> Self
pub fn should_compact(&self, current_tokens: u64, limit: u64) -> bool
pub async fn compact( &self, conversation: &Conversation, provider: &dyn Provider, ) -> AppResult<Conversation>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AutoCompactor
impl RefUnwindSafe for AutoCompactor
impl Send for AutoCompactor
impl Sync for AutoCompactor
impl Unpin for AutoCompactor
impl UnsafeUnpin for AutoCompactor
impl UnwindSafe for AutoCompactor
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