pub struct StopPolicyStats<'a> {
pub step: usize,
pub step_tool_call_count: usize,
pub total_tool_call_count: usize,
pub total_input_tokens: usize,
pub total_output_tokens: usize,
pub consecutive_errors: usize,
pub elapsed: Duration,
pub last_tool_calls: &'a [ToolCall],
pub last_text: &'a str,
pub tool_call_history: &'a VecDeque<Vec<String>>,
}Expand description
Aggregated runtime stats consumed by stop policies.
Fields§
§step: usizeNumber of completed steps.
step_tool_call_count: usizeTool calls emitted by the current step.
total_tool_call_count: usizeTotal tool calls across the whole run.
total_input_tokens: usizeCumulative input tokens across all LLM calls.
total_output_tokens: usizeCumulative output tokens across all LLM calls.
consecutive_errors: usizeNumber of consecutive rounds where all tools failed.
elapsed: DurationTime elapsed since the loop started.
last_tool_calls: &'a [ToolCall]Tool calls from the most recent LLM response.
last_text: &'a strText from the most recent LLM response.
tool_call_history: &'a VecDeque<Vec<String>>History of tool call names per round (most recent last), for loop detection.
Auto Trait Implementations§
impl<'a> Freeze for StopPolicyStats<'a>
impl<'a> RefUnwindSafe for StopPolicyStats<'a>
impl<'a> Send for StopPolicyStats<'a>
impl<'a> Sync for StopPolicyStats<'a>
impl<'a> Unpin for StopPolicyStats<'a>
impl<'a> UnwindSafe for StopPolicyStats<'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