pub struct BoxedChatConstraintsForType<T> { /* private fields */ }
Expand description
A constraints for CreateDefaultChatConstraintsForType
that work with boxed StructuredChatModel
s.
Trait Implementations§
Source§impl<T> ModelConstraints for BoxedChatConstraintsForType<T>
impl<T> ModelConstraints for BoxedChatConstraintsForType<T>
Source§impl<T: 'static> StructuredChatModel<BoxedChatConstraintsForType<T>> for BoxedStructuredChatModel<T>
impl<T: 'static> StructuredChatModel<BoxedChatConstraintsForType<T>> for BoxedStructuredChatModel<T>
Source§fn add_message_with_callback_and_constraints<'a>(
&'a self,
session: &'a mut Self::ChatSession,
messages: &[ChatMessage],
sampler: GenerationParameters,
constraints: BoxedChatConstraintsForType<T>,
on_token: impl FnMut(String) -> Result<(), Self::Error> + Send + Sync + 'static,
) -> impl Future<Output = Result<T, Self::Error>> + Send + 'a
fn add_message_with_callback_and_constraints<'a>( &'a self, session: &'a mut Self::ChatSession, messages: &[ChatMessage], sampler: GenerationParameters, constraints: BoxedChatConstraintsForType<T>, on_token: impl FnMut(String) -> Result<(), Self::Error> + Send + Sync + 'static, ) -> impl Future<Output = Result<T, 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
Auto Trait Implementations§
impl<T> Freeze for BoxedChatConstraintsForType<T>
impl<T> RefUnwindSafe for BoxedChatConstraintsForType<T>where
T: RefUnwindSafe,
impl<T> Send for BoxedChatConstraintsForType<T>where
T: Send,
impl<T> Sync for BoxedChatConstraintsForType<T>where
T: Sync,
impl<T> Unpin for BoxedChatConstraintsForType<T>where
T: Unpin,
impl<T> UnwindSafe for BoxedChatConstraintsForType<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