pub struct StepIterator<'a, P: Provider, C: ContextStrategy> { /* private fields */ }Expand description
Step-by-step iterator over the agentic loop.
Allows driving the loop one turn at a time with full control between turns: inspect messages, inject new messages, modify tools.
Created via AgentLoop::run_step.
Implementations§
Source§impl<'a, P: Provider, C: ContextStrategy> StepIterator<'a, P, C>
impl<'a, P: Provider, C: ContextStrategy> StepIterator<'a, P, C>
Sourcepub async fn next(&mut self) -> Option<TurnResult>
pub async fn next(&mut self) -> Option<TurnResult>
Advance the loop by one turn.
Returns None if the loop has already completed (final response
was returned or an error occurred).
Sourcepub fn inject_message(&mut self, message: Message)
pub fn inject_message(&mut self, message: Message)
Inject a message into the conversation between turns.
Sourcepub fn tools_mut(&mut self) -> &mut ToolRegistry
pub fn tools_mut(&mut self) -> &mut ToolRegistry
Returns a mutable reference to the tool registry.
Auto Trait Implementations§
impl<'a, P, C> Freeze for StepIterator<'a, P, C>
impl<'a, P, C> !RefUnwindSafe for StepIterator<'a, P, C>
impl<'a, P, C> Send for StepIterator<'a, P, C>
impl<'a, P, C> Sync for StepIterator<'a, P, C>
impl<'a, P, C> Unpin for StepIterator<'a, P, C>
impl<'a, P, C> UnsafeUnpin for StepIterator<'a, P, C>
impl<'a, P, C> !UnwindSafe for StepIterator<'a, P, C>
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