pub struct RunnableSequence<I, M, O>{ /* private fields */ }Expand description
Chains two runnables: output of first feeds into second.
Created automatically via the | operator on BoxRunnable.
Trait Implementations§
Source§impl<I, M, O> Runnable<I, O> for RunnableSequence<I, M, O>
impl<I, M, O> Runnable<I, O> for RunnableSequence<I, M, O>
Source§fn stream<'a>(
&'a self,
input: I,
config: &'a RunnableConfig,
) -> RunnableOutputStream<'a, O>where
I: 'a,
fn stream<'a>(
&'a self,
input: I,
config: &'a RunnableConfig,
) -> RunnableOutputStream<'a, O>where
I: 'a,
Stream: invoke first step fully, then stream the second step. This matches LangChain behavior where only the final component truly streams.
Source§fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
input: I,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<O, SynapseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
input: I,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<O, SynapseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute this runnable on a single input.
Source§fn batch<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: Vec<I>,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Vec<Result<O, SynapseError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn batch<'life0, 'life1, 'async_trait>(
&'life0 self,
inputs: Vec<I>,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Vec<Result<O, SynapseError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute this runnable on multiple inputs sequentially.
Source§fn boxed(self) -> BoxRunnable<I, O>where
Self: Sized + 'static,
fn boxed(self) -> BoxRunnable<I, O>where
Self: Sized + 'static,
Wrap this runnable into a type-erased
BoxRunnable for composition via |.Auto Trait Implementations§
impl<I, M, O> Freeze for RunnableSequence<I, M, O>
impl<I, M, O> !RefUnwindSafe for RunnableSequence<I, M, O>
impl<I, M, O> Send for RunnableSequence<I, M, O>
impl<I, M, O> Sync for RunnableSequence<I, M, O>
impl<I, M, O> Unpin for RunnableSequence<I, M, O>
impl<I, M, O> UnsafeUnpin for RunnableSequence<I, M, O>
impl<I, M, O> !UnwindSafe for RunnableSequence<I, M, O>
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