Skip to main content

TypedRun

Type Alias TypedRun 

Source
pub type TypedRun<T> = AgentRunner<TypedOutput<T>>;
Expand description

A run that deserializes its accepted output as T.

Configure it with the same setters as AgentRunner, then .await it for a TypedPromptResponse<T>. With a retries budget, a failed attempt (run error, empty output, unparseable output) is retried from scratch; usage accumulates across attempts.

Aliased Type§

pub struct TypedRun<T> { /* private fields */ }

Implementations§

Source§

impl<T> TypedRun<T>

Source

pub fn retries(self, retries: usize) -> Self

Retry a failed attempt up to retries more times. An attempt fails when the run errors, produces no output, or produces output that does not parse as T. Usage accumulates across attempts.

Trait Implementations§

Source§

impl<T> IntoFuture for TypedRun<T>

Source§

type Output = Result<TypedPromptResponse<T>, StructuredOutputError>

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = <AgentRunner<TypedOutput<T>> as IntoFuture>::Output> + Send>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more