pub struct StructuredOutputParser<T = Value> { /* private fields */ }Expand description
A parser that extracts structured output from LlmResponse.
It prioritizes tool_calls (first call args), then falls back to parsing content as JSON.
Implementations§
Source§impl<T> StructuredOutputParser<T>
impl<T> StructuredOutputParser<T>
Trait Implementations§
Source§impl<T: Clone> Clone for StructuredOutputParser<T>
impl<T: Clone> Clone for StructuredOutputParser<T>
Source§fn clone(&self) -> StructuredOutputParser<T>
fn clone(&self) -> StructuredOutputParser<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 StructuredOutputParser<T>
impl<T: Default> Default for StructuredOutputParser<T>
Source§fn default() -> StructuredOutputParser<T>
fn default() -> StructuredOutputParser<T>
Returns the “default value” for a type. Read more
Source§impl<T: DeserializeOwned + Serialize + Send + Sync + 'static> Runnable<LlmResponse, T> for StructuredOutputParser<T>
impl<T: DeserializeOwned + Serialize + Send + Sync + 'static> Runnable<LlmResponse, T> for StructuredOutputParser<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 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 StructuredOutputParser<T>
impl<T> RefUnwindSafe for StructuredOutputParser<T>where
T: RefUnwindSafe,
impl<T> Send for StructuredOutputParser<T>where
T: Send,
impl<T> Sync for StructuredOutputParser<T>where
T: Sync,
impl<T> Unpin for StructuredOutputParser<T>where
T: Unpin,
impl<T> UnsafeUnpin for StructuredOutputParser<T>
impl<T> UnwindSafe for StructuredOutputParser<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