Struct llm_chain_openai::chatgpt::Step
source · 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(prompt: Prompt) -> Step<Executor>
pub fn for_prompt_with_streaming(prompt: Prompt) -> Step<Executor>
pub fn for_prompt_and_options( prompt: Prompt, options: <Executor as Executor>::PerInvocationOptions ) -> Step<Executor>
pub fn prompt(&self) -> &Prompt
pub fn options(&self) -> Option<&<Executor as Executor>::PerInvocationOptions>
pub fn is_streaming(&self) -> Option<bool>
sourcepub fn to_chain(self) -> Chain<Executor>where
Step<Executor>: Sized,
pub fn to_chain(self) -> Chain<Executor>where Step<Executor>: Sized,
Converts this step into a sequential chain with a single step.
Returns
A sequential chain containing this step.
pub async fn run( &self, parameters: &Parameters, executor: &Executor ) -> impl Future<Output = Result<<Executor as Executor>::Output, <Executor as Executor>::Error>>where Step<Executor>: Sized,
Trait Implementations§
source§impl<Executor> Clone for Step<Executor>where
Executor: Clone + Executor,
<Executor as Executor>::PerInvocationOptions: Clone,
impl<Executor> Clone for Step<Executor>where Executor: Clone + Executor, <Executor as Executor>::PerInvocationOptions: Clone,
source§impl<Executor> Debug for Step<Executor>where
Executor: Debug + Executor,
<Executor as Executor>::PerInvocationOptions: Debug,
impl<Executor> Debug for Step<Executor>where Executor: Debug + Executor, <Executor as Executor>::PerInvocationOptions: Debug,
source§impl<'de, E> Deserialize<'de> for Step<E>where
E: Executor,
impl<'de, E> Deserialize<'de> for Step<E>where E: Executor,
source§fn deserialize<D>(
deserializer: D
) -> Result<Step<E>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Step<E>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<E> Serialize for Step<E>where
E: Executor,
impl<E> Serialize for Step<E>where E: Executor,
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. 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