pub struct RunnableSequence<R1, R2>{ /* private fields */ }Expand description
A sequence of Runnables that are executed one after another.
The output of one Runnable is the input to the next. This is the most common composition pattern in LangChain.
Implementations§
Trait Implementations§
Source§impl<R1, R2> Debug for RunnableSequence<R1, R2>
impl<R1, R2> Debug for RunnableSequence<R1, R2>
Source§impl<R1, R2> Runnable for RunnableSequence<R1, R2>
impl<R1, R2> Runnable for RunnableSequence<R1, R2>
Source§fn invoke(
&self,
input: Self::Input,
config: Option<RunnableConfig>,
) -> Result<Self::Output>
fn invoke( &self, input: Self::Input, config: Option<RunnableConfig>, ) -> Result<Self::Output>
Transform a single input into an output. Read more
Source§fn ainvoke<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'static + 'async_trait,
'life0: 'async_trait,
fn ainvoke<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'static + 'async_trait,
'life0: 'async_trait,
Transform a single input into an output asynchronously. Read more
Source§fn stream(
&self,
input: Self::Input,
config: Option<RunnableConfig>,
) -> BoxStream<'_, Result<Self::Output>>
fn stream( &self, input: Self::Input, config: Option<RunnableConfig>, ) -> BoxStream<'_, Result<Self::Output>>
Stream output from a single input. Read more
Source§fn get_name(&self, suffix: Option<&str>, name: Option<&str>) -> String
fn get_name(&self, suffix: Option<&str>, name: Option<&str>) -> String
Get the name of this Runnable.
Source§fn batch(
&self,
inputs: Vec<Self::Input>,
config: Option<ConfigOrList>,
_return_exceptions: bool,
) -> Vec<Result<Self::Output>> ⓘwhere
Self: 'static,
fn batch(
&self,
inputs: Vec<Self::Input>,
config: Option<ConfigOrList>,
_return_exceptions: bool,
) -> Vec<Result<Self::Output>> ⓘwhere
Self: 'static,
Transform multiple inputs into outputs in parallel. Read more
Source§fn abatch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Self::Input>,
config: Option<ConfigOrList>,
_return_exceptions: bool,
) -> Pin<Box<dyn Future<Output = Vec<Result<Self::Output>>> + Send + 'async_trait>>where
Self: 'static + 'async_trait,
'life0: 'async_trait,
fn abatch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Self::Input>,
config: Option<ConfigOrList>,
_return_exceptions: bool,
) -> Pin<Box<dyn Future<Output = Vec<Result<Self::Output>>> + Send + 'async_trait>>where
Self: 'static + 'async_trait,
'life0: 'async_trait,
Transform multiple inputs into outputs asynchronously. Read more
Source§fn astream(
&self,
input: Self::Input,
config: Option<RunnableConfig>,
) -> BoxStream<'_, Result<Self::Output>>where
Self: 'static,
fn astream(
&self,
input: Self::Input,
config: Option<RunnableConfig>,
) -> BoxStream<'_, Result<Self::Output>>where
Self: 'static,
Stream output from a single input asynchronously. Read more
Source§fn transform<'a>(
&'a self,
input: BoxStream<'a, Self::Input>,
config: Option<RunnableConfig>,
) -> BoxStream<'a, Result<Self::Output>>
fn transform<'a>( &'a self, input: BoxStream<'a, Self::Input>, config: Option<RunnableConfig>, ) -> BoxStream<'a, Result<Self::Output>>
Transform an input stream into an output stream. Read more
Source§fn atransform<'a>(
&'a self,
input: BoxStream<'a, Self::Input>,
config: Option<RunnableConfig>,
) -> BoxStream<'a, Result<Self::Output>>where
Self: 'static,
fn atransform<'a>(
&'a self,
input: BoxStream<'a, Self::Input>,
config: Option<RunnableConfig>,
) -> BoxStream<'a, Result<Self::Output>>where
Self: 'static,
Transform an input stream into an output stream asynchronously. Read more
Source§fn bind(self, kwargs: HashMap<String, Value>) -> RunnableBinding<Self>where
Self: Sized,
fn bind(self, kwargs: HashMap<String, Value>) -> RunnableBinding<Self>where
Self: Sized,
Bind arguments to this Runnable, returning a new Runnable.
Source§fn with_config(self, config: RunnableConfig) -> RunnableBinding<Self>where
Self: Sized,
fn with_config(self, config: RunnableConfig) -> RunnableBinding<Self>where
Self: Sized,
Bind config to this Runnable, returning a new Runnable.
Source§fn with_retry(
self,
max_attempts: usize,
wait_exponential_jitter: bool,
) -> RunnableRetry<Self>where
Self: Sized,
fn with_retry(
self,
max_attempts: usize,
wait_exponential_jitter: bool,
) -> RunnableRetry<Self>where
Self: Sized,
Create a new Runnable that retries on failure. Read more
Source§fn map(self) -> RunnableEach<Self>where
Self: Sized,
fn map(self) -> RunnableEach<Self>where
Self: Sized,
Return a new Runnable that maps a list of inputs to a list of outputs.
Auto Trait Implementations§
impl<R1, R2> Freeze for RunnableSequence<R1, R2>
impl<R1, R2> RefUnwindSafe for RunnableSequence<R1, R2>where
R1: RefUnwindSafe,
R2: RefUnwindSafe,
impl<R1, R2> Send for RunnableSequence<R1, R2>
impl<R1, R2> Sync for RunnableSequence<R1, R2>
impl<R1, R2> Unpin for RunnableSequence<R1, R2>
impl<R1, R2> UnwindSafe for RunnableSequence<R1, R2>where
R1: UnwindSafe,
R2: 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
Source§impl<R> ConfigurableRunnable for Rwhere
R: Runnable,
impl<R> ConfigurableRunnable for Rwhere
R: Runnable,
Source§fn configurable_fields(
self,
fields: HashMap<String, AnyConfigurableField>,
) -> RunnableConfigurableFields<Self::Input, Self::Output>
fn configurable_fields( self, fields: HashMap<String, AnyConfigurableField>, ) -> RunnableConfigurableFields<Self::Input, Self::Output>
Create a configurable version of this runnable that allows configuring specific fields. Read more
Source§fn configurable_alternatives(
self,
which: ConfigurableField,
alternatives: HashMap<String, Alternative<Self::Input, Self::Output>>,
default_key: impl Into<String>,
prefix_keys: bool,
) -> RunnableConfigurableAlternatives<Self::Input, Self::Output>
fn configurable_alternatives( self, which: ConfigurableField, alternatives: HashMap<String, Alternative<Self::Input, Self::Output>>, default_key: impl Into<String>, prefix_keys: bool, ) -> RunnableConfigurableAlternatives<Self::Input, Self::Output>
Create a configurable version of this runnable that allows selecting between alternatives. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R> RunnableRetryExt for Rwhere
R: Runnable,
impl<R> RunnableRetryExt for Rwhere
R: Runnable,
Source§fn with_retry_config(self, config: RunnableRetryConfig) -> RunnableRetry<Self>where
Self: Sized,
fn with_retry_config(self, config: RunnableRetryConfig) -> RunnableRetry<Self>where
Self: Sized,
Create a new Runnable that retries this runnable on failure with full config. Read more
Source§impl<R> RunnableWithFallbacksExt for Rwhere
R: Runnable,
impl<R> RunnableWithFallbacksExt for Rwhere
R: Runnable,
Source§fn with_fallbacks(
self,
fallbacks: Vec<DynRunnable<Self::Input, Self::Output>>,
) -> RunnableWithFallbacks<Self::Input, Self::Output>
fn with_fallbacks( self, fallbacks: Vec<DynRunnable<Self::Input, Self::Output>>, ) -> RunnableWithFallbacks<Self::Input, Self::Output>
Create a new Runnable that tries this runnable first, then falls back to others. Read more