Trait llm_chain::traits::Step

source ·
pub trait Step {
    type Output: Send;
    type Error: Send + Debug + Error + StepError;

    // Required method
    fn format(
        &self,
        parameters: &Parameters
    ) -> Result<Self::Output, Self::Error>;
}
Expand description

The Step trait represents a single step in a chain. It takes a set of parameters and returns a formatted prompt that can be used by an executor.

Required Associated Types§

source

type Output: Send

The output type produced by this step.

source

type Error: Send + Debug + Error + StepError

Required Methods§

source

fn format(&self, parameters: &Parameters) -> Result<Self::Output, Self::Error>

Formats the step given a set of parameters, returning a value that can be used by an executor.

Parameters
  • parameters: The parameters used to format the step.
Returns

The formatted output of this step or an error if the step could not be formatted.

Implementors§