pub struct StopContext<'a> {
pub iteration: u32,
pub response: &'a ChatResponse,
pub total_usage: &'a Usage,
pub tool_calls_executed: usize,
pub last_tool_results: &'a [ToolResult],
}Expand description
Context provided to stop condition callbacks.
Contains information about the current state of the tool loop to help decide whether to stop early.
Fields§
§iteration: u32Current iteration number (1-indexed).
response: &'a ChatResponseThe response from this iteration.
total_usage: &'a UsageAccumulated usage across all iterations so far.
tool_calls_executed: usizeTotal number of tool calls executed so far (across all iterations).
last_tool_results: &'a [ToolResult]Tool results from the most recent execution (empty on first response).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for StopContext<'a>
impl<'a> RefUnwindSafe for StopContext<'a>
impl<'a> Send for StopContext<'a>
impl<'a> Sync for StopContext<'a>
impl<'a> Unpin for StopContext<'a>
impl<'a> UnwindSafe for StopContext<'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