pub struct SchemaParser<P> { /* private fields */ }
Expand description
A parser for any type that implements the Schema
trait and Deserialize
.
Implementations§
Source§impl<P> SchemaParser<P>
impl<P> SchemaParser<P>
Trait Implementations§
Source§impl<P: Clone> Clone for SchemaParser<P>
impl<P: Clone> Clone for SchemaParser<P>
Source§fn clone(&self) -> SchemaParser<P>
fn clone(&self) -> SchemaParser<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<P: Debug> Debug for SchemaParser<P>
impl<P: Debug> Debug for SchemaParser<P>
Source§impl<P> Default for SchemaParser<P>
impl<P> Default for SchemaParser<P>
Source§impl<P> ModelConstraints for SchemaParser<P>
impl<P> ModelConstraints for SchemaParser<P>
Source§impl<P> StructuredChatModel<SchemaParser<P>> for OpenAICompatibleChatModelwhere
P: Schema + DeserializeOwned,
impl<P> StructuredChatModel<SchemaParser<P>> for OpenAICompatibleChatModelwhere
P: Schema + DeserializeOwned,
Source§fn add_message_with_callback_and_constraints<'a>(
&'a self,
session: &'a mut Self::ChatSession,
messages: &[ChatMessage],
sampler: GenerationParameters,
_: SchemaParser<P>,
on_token: impl FnMut(String) -> Result<(), Self::Error> + Send + Sync + 'static,
) -> impl Future<Output = Result<P, Self::Error>> + Send + 'a
fn add_message_with_callback_and_constraints<'a>( &'a self, session: &'a mut Self::ChatSession, messages: &[ChatMessage], sampler: GenerationParameters, _: SchemaParser<P>, on_token: impl FnMut(String) -> Result<(), Self::Error> + Send + Sync + 'static, ) -> impl Future<Output = Result<P, Self::Error>> + Send + 'a
Add messages to the chat session with a callback that is called for each token and a constraints the response must follow. Read more
impl<P: Copy> Copy for SchemaParser<P>
Auto Trait Implementations§
impl<P> Freeze for SchemaParser<P>
impl<P> RefUnwindSafe for SchemaParser<P>where
P: RefUnwindSafe,
impl<P> Send for SchemaParser<P>where
P: Send,
impl<P> Sync for SchemaParser<P>where
P: Sync,
impl<P> Unpin for SchemaParser<P>where
P: Unpin,
impl<P> UnwindSafe for SchemaParser<P>where
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