pub struct RunnablePassthrough;Expand description
Passes the input through unchanged. Useful in parallel compositions where one branch should preserve the original input.
Implementations§
Source§impl RunnablePassthrough
impl RunnablePassthrough
Sourcepub fn assign(
branches: Vec<(String, BoxRunnable<Value, Value>)>,
) -> RunnableAssign
pub fn assign( branches: Vec<(String, BoxRunnable<Value, Value>)>, ) -> RunnableAssign
Create a RunnableAssign that passes input through and merges additional computed keys.
Trait Implementations§
Source§impl Clone for RunnablePassthrough
impl Clone for RunnablePassthrough
Source§fn clone(&self) -> RunnablePassthrough
fn clone(&self) -> RunnablePassthrough
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunnablePassthrough
impl Debug for RunnablePassthrough
Source§impl Default for RunnablePassthrough
impl Default for RunnablePassthrough
Source§fn default() -> RunnablePassthrough
fn default() -> RunnablePassthrough
Returns the “default value” for a type. Read more
Source§impl<T> Runnable<T, T> for RunnablePassthrough
impl<T> Runnable<T, T> for RunnablePassthrough
Source§fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
input: T,
_config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<T, SynapseError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
input: T,
_config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<T, 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 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 the output. Default wraps
invoke as a single-item stream.
Override for true streaming (e.g., token-by-token from an LLM).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 |.impl Copy for RunnablePassthrough
Auto Trait Implementations§
impl Freeze for RunnablePassthrough
impl RefUnwindSafe for RunnablePassthrough
impl Send for RunnablePassthrough
impl Sync for RunnablePassthrough
impl Unpin for RunnablePassthrough
impl UnsafeUnpin for RunnablePassthrough
impl UnwindSafe for RunnablePassthrough
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