pub struct Step { /* private fields */ }
Expand description
A step in a chain of LLM invocations. It is a combination of a prompt and a configuration.
Implementations§
Source§impl Step
impl Step
pub fn for_prompt_template(prompt: PromptTemplate) -> Self
pub fn for_prompt_with_streaming(prompt: PromptTemplate) -> Self
pub fn for_prompt_and_options(prompt: PromptTemplate, options: Options) -> Self
pub fn prompt(&self) -> &PromptTemplate
pub fn options(&self) -> &Options
Sourcepub fn to_chain(self) -> Chainwhere
Self: Sized,
pub fn to_chain(self) -> Chainwhere
Self: Sized,
Converts this step into a sequential chain with a single step.
§Returns
A sequential chain containing this step.
Sourcepub fn format(
&self,
parameters: &Parameters,
) -> Result<Prompt, StringTemplateError>
pub fn format( &self, parameters: &Parameters, ) -> Result<Prompt, StringTemplateError>
Formats the prompt for this step with the given parameters.
Sourcepub async fn run<E>(
&self,
parameters: &Parameters,
executor: &E,
) -> Result<Output, FormatAndExecuteError>
pub async fn run<E>( &self, parameters: &Parameters, executor: &E, ) -> Result<Output, FormatAndExecuteError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Step
impl<'de> Deserialize<'de> for Step
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
Auto Trait Implementations§
impl Freeze for Step
impl RefUnwindSafe for Step
impl Send for Step
impl Sync for Step
impl Unpin for Step
impl UnwindSafe for Step
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