pub struct Folded {
pub budget_tokens: usize,
}Expand description
An append-only conversation, bounded by folding.
Folded sends [opening] [digest 1] … [digest k] [verbatim tail]. Once the verbatim part
passes budget_tokens, its older half becomes one harness-written digest. Boundaries are
computed greedily from the start of history, so each depends only on the messages before it:
the next turn reproduces every earlier fold exactly, and between folds the output is pure
append. A cut never separates a tool call from its result.
Fields§
§budget_tokens: usizeApproximate token budget (characters / 4) for the verbatim tail.
Trait Implementations§
Source§impl ContextStrategy for Folded
impl ContextStrategy for Folded
Source§fn build(&self, _state: &State, history: &[Message]) -> Vec<Message>
fn build(&self, _state: &State, history: &[Message]) -> Vec<Message>
Build the messages for the next call from the run so far.
Auto Trait Implementations§
impl Forget for Folded
impl Freeze for Folded
impl Move for Folded
impl RefUnwindSafe for Folded
impl Send for Folded
impl Sync for Folded
impl Unpin for Folded
impl UnsafeUnpin for Folded
impl UnwindSafe for Folded
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