pub enum LoopStep {
Interrupt(LoopInterrupt),
Finished(TurnResult),
}Expand description
The result of advancing the agent loop by one step.
Returned by LoopDriver::next. The host should pattern-match on this
to decide whether to continue the loop or resolve an interrupt first.
§Example
use agentkit_loop::LoopStep;
loop {
match driver.next().await? {
LoopStep::Finished(result) => {
println!("Turn complete: {:?}", result.finish_reason);
break;
}
LoopStep::Interrupt(interrupt) => {
// Resolve the interrupt, then continue the loop.
}
}
}Variants§
Interrupt(LoopInterrupt)
The loop is paused and requires host action.
Finished(TurnResult)
A turn has completed (or been cancelled).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LoopStep
impl<'de> Deserialize<'de> for LoopStep
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for LoopStep
Auto Trait Implementations§
impl Freeze for LoopStep
impl RefUnwindSafe for LoopStep
impl Send for LoopStep
impl Sync for LoopStep
impl Unpin for LoopStep
impl UnsafeUnpin for LoopStep
impl UnwindSafe for LoopStep
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