pub struct Session<'a, M: Model> { /* private fields */ }Expand description
A persistent multi-turn conversation over one AgentLoop.
Holds the append-only history and, on each turn, re-runs
the loop against a stable prefix (system + name-sorted tool schemas).
That byte-stable prefix is what lets a provider’s prefix cache hit across
turns — the difference between paying full price to re-read the same context
every round and paying ~10% for the cached bytes (DeepSeek).
Implementations§
Auto Trait Implementations§
impl<'a, M> !RefUnwindSafe for Session<'a, M>
impl<'a, M> !UnwindSafe for Session<'a, M>
impl<'a, M> Freeze for Session<'a, M>
impl<'a, M> Send for Session<'a, M>
impl<'a, M> Sync for Session<'a, M>
impl<'a, M> Unpin for Session<'a, M>
impl<'a, M> UnsafeUnpin for Session<'a, M>
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