pub struct CompactContext<'a> {
pub session_id: &'a str,
pub turn_id: &'a str,
pub model: &'a str,
pub input: &'a [Value],
pub events: &'a mut Vec<EventMsg>,
/* private fields */
}Expand description
State exposed immediately before or after context compaction.
Fields§
§session_id: &'a strThe session identifier.
turn_id: &'a strThe turn identifier.
model: &'a strThe model.
input: &'a [Value]The input.
events: &'a mut Vec<EventMsg>The events.
Implementations§
Source§impl CompactContext<'_>
impl CompactContext<'_>
Sourcepub fn stop(&mut self, reason: impl Into<String>) -> Result<()>
pub fn stop(&mut self, reason: impl Into<String>) -> Result<()>
Stops the active turn at this compaction boundary.
§Errors
Returns an error if validation or an operation required by this function fails.
Sourcepub fn stop_reason(&self) -> Option<&str>
pub fn stop_reason(&self) -> Option<&str>
Returns the first stop requested by the ordered middleware chain.
Auto Trait Implementations§
impl<'a> !UnwindSafe for CompactContext<'a>
impl<'a> Freeze for CompactContext<'a>
impl<'a> RefUnwindSafe for CompactContext<'a>
impl<'a> Send for CompactContext<'a>
impl<'a> Sync for CompactContext<'a>
impl<'a> Unpin for CompactContext<'a>
impl<'a> UnsafeUnpin for CompactContext<'a>
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