Skip to main content

TurnStep

Trait TurnStep 

Source
pub trait TurnStep<P, T>: Send + Sync
where P: LlmProvider + ?Sized, T: ToolExecutor + ?Sized,
{ // Required method fn run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 mut TurnCtx<'life2, P, T>, ) -> Pin<Box<dyn Future<Output = Result<StepOutcome, P::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; }
Expand description

One cohesive slice of turn behavior the turn loop drives.

Each step reads and mutates the turn’s working state through TurnCtx and reports a StepOutcome. Generic over the provider P and tool executor T so a step can dial the provider and use the turn’s error type directly.

Required Methods§

Source

fn run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 mut TurnCtx<'life2, P, T>, ) -> Pin<Box<dyn Future<Output = Result<StepOutcome, P::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Run this step against the turn context.

§Errors

Returns the provider’s error type when the step fails in a way that should abort the turn. A step that is best-effort swallows its own provider failures and returns StepOutcome::Continue instead.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P, T> TurnStep<P, T> for CircuitBreaker
where P: LlmProvider + ?Sized, T: ToolExecutor + ?Sized,

Source§

impl<P, T> TurnStep<P, T> for ForcedCompletion
where P: LlmProvider + ?Sized, T: ToolExecutor + ?Sized,

Source§

impl<P, T> TurnStep<P, T> for ResumePrePass<'_>
where P: LlmProvider + ?Sized, T: ToolExecutor + ?Sized,