pub struct TruncateStrategy {
pub keep_last: usize,
}Expand description
Keep only the system prompt (first message) and the last keep_last messages.
This is a message-count strategy; max_tokens is accepted through the
common strategy trait but is not used for token-aware trimming.
Fields§
§keep_last: usizeNumber of recent messages to preserve.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TruncateStrategy
impl RefUnwindSafe for TruncateStrategy
impl Send for TruncateStrategy
impl Sync for TruncateStrategy
impl Unpin for TruncateStrategy
impl UnsafeUnpin for TruncateStrategy
impl UnwindSafe for TruncateStrategy
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