pub struct BoxedChatModel { /* private fields */ }
Expand description
A boxed ChatModel
.
Trait Implementations§
Source§impl ChatModel for BoxedChatModel
impl ChatModel for BoxedChatModel
Source§fn add_messages_with_callback<'a>(
&'a self,
session: &'a mut Self::ChatSession,
messages: &[ChatMessage],
sampler: GenerationParameters,
on_token: impl FnMut(String) -> Result<(), Self::Error> + Send + Sync + 'static,
) -> impl Future<Output = Result<(), Self::Error>> + Send + 'a
fn add_messages_with_callback<'a>( &'a self, session: &'a mut Self::ChatSession, messages: &[ChatMessage], sampler: GenerationParameters, on_token: impl FnMut(String) -> Result<(), Self::Error> + Send + Sync + 'static, ) -> impl Future<Output = Result<(), Self::Error>> + Send + 'a
Add messages to the chat session with a callback that is called for each token. Read more
Source§impl Clone for BoxedChatModel
impl Clone for BoxedChatModel
Source§fn clone(&self) -> BoxedChatModel
fn clone(&self) -> BoxedChatModel
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 CreateChatSession for BoxedChatModel
impl CreateChatSession for BoxedChatModel
Source§type ChatSession = BoxedChatSession
type ChatSession = BoxedChatSession
The type of chat session.
Source§type Error = Box<dyn Error + Send + Sync>
type Error = Box<dyn Error + Send + Sync>
The type of error the chat session may return during operations.
Source§fn new_chat_session(&self) -> Result<Self::ChatSession, Self::Error>
fn new_chat_session(&self) -> Result<Self::ChatSession, Self::Error>
Create a new chat session for this model. Read more
Auto Trait Implementations§
impl Freeze for BoxedChatModel
impl !RefUnwindSafe for BoxedChatModel
impl Send for BoxedChatModel
impl Sync for BoxedChatModel
impl Unpin for BoxedChatModel
impl !UnwindSafe for BoxedChatModel
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
Source§impl<M> ChatModelExt for Mwhere
M: CreateChatSession,
impl<M> ChatModelExt for Mwhere
M: CreateChatSession,
Source§fn chat(&self) -> Chat<Self>where
Self: Clone,
fn chat(&self) -> Chat<Self>where
Self: Clone,
Create a new chat session with the model.
Let’s start with a simple chat application: Read more
Source§fn task(&self, description: impl ToString) -> Task<Self>where
Self: Clone,
fn task(&self, description: impl ToString) -> Task<Self>where
Self: Clone,
Create a new task with the model. Read more
Source§fn boxed_chat_model(self) -> BoxedChatModel
fn boxed_chat_model(self) -> BoxedChatModel
Source§fn boxed_typed_chat_model<T>(self) -> BoxedStructuredChatModel<T>where
Self: StructuredChatModel<Self::DefaultConstraints, Error: Send + Sync + Error + 'static, ChatSession: ChatSession<Error: Error + Send + Sync + 'static> + Clone + Send + Sync + 'static> + CreateDefaultChatConstraintsForType<T> + Sized + Send + Sync + 'static,
T: 'static,
fn boxed_typed_chat_model<T>(self) -> BoxedStructuredChatModel<T>where
Self: StructuredChatModel<Self::DefaultConstraints, Error: Send + Sync + Error + 'static, ChatSession: ChatSession<Error: Error + Send + Sync + 'static> + Clone + Send + Sync + 'static> + CreateDefaultChatConstraintsForType<T> + Sized + Send + Sync + 'static,
T: 'static,
Erase the type of the structured chat model. This can be used to make multiple implementations of
StructuredChatModel
compatible with the same type. Read more