pub struct JsonOutputParser<T = Value> { /* private fields */ }Expand description
A parser that parses a JSON string (or LlmResponse content) into a structured type or Value.
Implementations§
Source§impl<T> JsonOutputParser<T>
impl<T> JsonOutputParser<T>
Trait Implementations§
Source§impl<T: Clone> Clone for JsonOutputParser<T>
impl<T: Clone> Clone for JsonOutputParser<T>
Source§fn clone(&self) -> JsonOutputParser<T>
fn clone(&self) -> JsonOutputParser<T>
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<T: Default> Default for JsonOutputParser<T>
impl<T: Default> Default for JsonOutputParser<T>
Source§fn default() -> JsonOutputParser<T>
fn default() -> JsonOutputParser<T>
Returns the “default value” for a type. Read more
Source§impl<T: DeserializeOwned + Serialize + Send + Sync + 'static> Runnable<LlmResponse, T> for JsonOutputParser<T>
impl<T: DeserializeOwned + Serialize + Send + Sync + 'static> Runnable<LlmResponse, T> for JsonOutputParser<T>
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: LlmResponse,
) -> Pin<Box<dyn Future<Output = Result<T, WesichainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream( &self, input: LlmResponse, ) -> 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>
Source§impl<T: DeserializeOwned + Serialize + Send + Sync + 'static> Runnable<String, T> for JsonOutputParser<T>
impl<T: DeserializeOwned + Serialize + Send + Sync + 'static> Runnable<String, T> for JsonOutputParser<T>
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: String,
) -> Pin<Box<dyn Future<Output = Result<T, WesichainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream( &self, input: String, ) -> 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,
Auto Trait Implementations§
impl<T> Freeze for JsonOutputParser<T>
impl<T> RefUnwindSafe for JsonOutputParser<T>where
T: RefUnwindSafe,
impl<T> Send for JsonOutputParser<T>where
T: Send,
impl<T> Sync for JsonOutputParser<T>where
T: Sync,
impl<T> Unpin for JsonOutputParser<T>where
T: Unpin,
impl<T> UnsafeUnpin for JsonOutputParser<T>
impl<T> UnwindSafe for JsonOutputParser<T>where
T: 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