pub struct OutputFixingParser<L, P> { /* private fields */ }Expand description
A parser/chain that wraps an LLM and a base parser. It attempts to invoke the LLM and parse the result. If parsing fails, it feeds the error back to the LLM to generate a fix.
Implementations§
Trait Implementations§
Source§impl<L: Clone, P: Clone> Clone for OutputFixingParser<L, P>
impl<L: Clone, P: Clone> Clone for OutputFixingParser<L, P>
Source§fn clone(&self) -> OutputFixingParser<L, P>
fn clone(&self) -> OutputFixingParser<L, P>
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<L, P, O> Runnable<LlmRequest, O> for OutputFixingParser<L, P>where
L: Runnable<LlmRequest, LlmResponse> + Clone + Send + Sync,
P: Runnable<LlmResponse, O> + Clone + Send + Sync,
O: Send + Sync + 'static,
impl<L, P, O> Runnable<LlmRequest, O> for OutputFixingParser<L, P>where
L: Runnable<LlmRequest, LlmResponse> + Clone + Send + Sync,
P: Runnable<LlmResponse, O> + Clone + Send + Sync,
O: Send + Sync + 'static,
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<O, WesichainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream( &self, input: LlmRequest, ) -> 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<L, P> Freeze for OutputFixingParser<L, P>
impl<L, P> RefUnwindSafe for OutputFixingParser<L, P>where
L: RefUnwindSafe,
P: RefUnwindSafe,
impl<L, P> Send for OutputFixingParser<L, P>
impl<L, P> Sync for OutputFixingParser<L, P>
impl<L, P> Unpin for OutputFixingParser<L, P>
impl<L, P> UnsafeUnpin for OutputFixingParser<L, P>where
L: UnsafeUnpin,
P: UnsafeUnpin,
impl<L, P> UnwindSafe for OutputFixingParser<L, P>where
L: UnwindSafe,
P: 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