pub struct StrOutputParser;Expand description
A parser that converts LlmResponse or String into a String.
If input is LlmResponse, it extracts the content.
Trait Implementations§
Source§impl Clone for StrOutputParser
impl Clone for StrOutputParser
Source§fn clone(&self) -> StrOutputParser
fn clone(&self) -> StrOutputParser
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 Default for StrOutputParser
impl Default for StrOutputParser
Source§fn default() -> StrOutputParser
fn default() -> StrOutputParser
Returns the “default value” for a type. Read more
Source§impl Runnable<LlmResponse, String> for StrOutputParser
impl Runnable<LlmResponse, String> for StrOutputParser
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: LlmResponse,
) -> Pin<Box<dyn Future<Output = Result<String, WesichainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream( &self, input: LlmResponse, ) -> BoxStream<'_, Result<StreamEvent, WesichainError>>
fn to_serializable(&self) -> Option<SerializableRunnable>
fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
) -> Pin<Box<dyn Future<Output = Vec<Result<Output, WesichainError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn abatch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
) -> Pin<Box<dyn Future<Output = Vec<Result<Output, WesichainError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Runnable<String, String> for StrOutputParser
impl Runnable<String, String> for StrOutputParser
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: String,
) -> Pin<Box<dyn Future<Output = Result<String, WesichainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream( &self, input: String, ) -> BoxStream<'_, Result<StreamEvent, WesichainError>>
fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
) -> Pin<Box<dyn Future<Output = Vec<Result<Output, WesichainError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn abatch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
) -> Pin<Box<dyn Future<Output = Vec<Result<Output, WesichainError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn to_serializable(&self) -> Option<SerializableRunnable>
Auto Trait Implementations§
impl Freeze for StrOutputParser
impl RefUnwindSafe for StrOutputParser
impl Send for StrOutputParser
impl Sync for StrOutputParser
impl Unpin for StrOutputParser
impl UnsafeUnpin for StrOutputParser
impl UnwindSafe for StrOutputParser
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