pub struct AnthropicCompatibleChatModel { /* private fields */ }Expand description
An chat model that uses Anthropic’s API for the a remote chat model.
Implementations§
Source§impl AnthropicCompatibleChatModel
impl AnthropicCompatibleChatModel
Sourcepub fn builder() -> AnthropicCompatibleChatModelBuilder<false>
pub fn builder() -> AnthropicCompatibleChatModelBuilder<false>
Create a new builder for the Anthropic compatible chat model.
Trait Implementations§
Source§impl ChatModel for AnthropicCompatibleChatModel
impl ChatModel for AnthropicCompatibleChatModel
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 AnthropicCompatibleChatModel
impl Clone for AnthropicCompatibleChatModel
Source§fn clone(&self) -> AnthropicCompatibleChatModel
fn clone(&self) -> AnthropicCompatibleChatModel
Returns a copy 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 CreateChatSession for AnthropicCompatibleChatModel
impl CreateChatSession for AnthropicCompatibleChatModel
Source§type ChatSession = AnthropicCompatibleChatSession
type ChatSession = AnthropicCompatibleChatSession
The type of chat session.
Source§type Error = AnthropicCompatibleChatModelError
type Error = AnthropicCompatibleChatModelError
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 AnthropicCompatibleChatModel
impl !RefUnwindSafe for AnthropicCompatibleChatModel
impl Send for AnthropicCompatibleChatModel
impl Sync for AnthropicCompatibleChatModel
impl Unpin for AnthropicCompatibleChatModel
impl !UnwindSafe for AnthropicCompatibleChatModel
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