pub struct Step<Executor>where
Executor: Executor,{ /* 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<Executor> Step<Executor>where
Executor: Executor,
impl<Executor> Step<Executor>where Executor: Executor,
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: Executor::PerInvocationOptions ) -> Self
pub fn prompt(&self) -> &PromptTemplate
pub fn options(&self) -> Option<&Executor::PerInvocationOptions>
pub fn is_streaming(&self) -> Option<bool>
sourcepub fn to_chain(self) -> Chain<Executor>where
Self: Sized,
pub fn to_chain(self) -> Chain<Executor>where 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(
&self,
parameters: &Parameters,
executor: &Executor
) -> Result<Executor::Output, FormatAndExecuteError<Executor::Error>>where
Self: Sized,
pub async fn run( &self, parameters: &Parameters, executor: &Executor ) -> Result<Executor::Output, FormatAndExecuteError<Executor::Error>>where Self: Sized,
Trait Implementations§
source§impl<Executor> Clone for Step<Executor>where
Executor: Executor + Clone,
Executor::PerInvocationOptions: Clone,
impl<Executor> Clone for Step<Executor>where Executor: Executor + Clone, Executor::PerInvocationOptions: Clone,
source§impl<Executor> Debug for Step<Executor>where
Executor: Executor + Debug,
Executor::PerInvocationOptions: Debug,
impl<Executor> Debug for Step<Executor>where Executor: Executor + Debug, Executor::PerInvocationOptions: Debug,
source§impl<'de, E: Executor> Deserialize<'de> for Step<E>
impl<'de, E: Executor> Deserialize<'de> for Step<E>
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<Executor> RefUnwindSafe for Step<Executor>where <Executor as Executor>::PerInvocationOptions: RefUnwindSafe,
impl<Executor> Send for Step<Executor>
impl<Executor> Sync for Step<Executor>
impl<Executor> Unpin for Step<Executor>where <Executor as Executor>::PerInvocationOptions: Unpin,
impl<Executor> UnwindSafe for Step<Executor>where <Executor as Executor>::PerInvocationOptions: UnwindSafe,
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