pub struct AnthropicCompatibleChatModelBuilder<const WITH_NAME: bool> { /* private fields */ }
Expand description
A builder for an Anthropic compatible chat model.
Implementations§
Source§impl AnthropicCompatibleChatModelBuilder<false>
impl AnthropicCompatibleChatModelBuilder<false>
Source§impl<const WITH_NAME: bool> AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> AnthropicCompatibleChatModelBuilder<WITH_NAME>
Sourcepub fn with_model(
self,
model: impl ToString,
) -> AnthropicCompatibleChatModelBuilder<true>
pub fn with_model( self, model: impl ToString, ) -> AnthropicCompatibleChatModelBuilder<true>
Set the name of the model to use.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Set the default max tokens to use when generating text.
Sourcepub fn with_claude_3_5_sonnet(self) -> AnthropicCompatibleChatModelBuilder<true>
pub fn with_claude_3_5_sonnet(self) -> AnthropicCompatibleChatModelBuilder<true>
Set the model to claude-3-5-sonnet-20241022
Sourcepub fn with_claude_3_5_haiku(self) -> AnthropicCompatibleChatModelBuilder<true>
pub fn with_claude_3_5_haiku(self) -> AnthropicCompatibleChatModelBuilder<true>
Set the model to claude-3-5-haiku-20241022
Sourcepub fn with_claude_3_opus(self) -> AnthropicCompatibleChatModelBuilder<true>
pub fn with_claude_3_opus(self) -> AnthropicCompatibleChatModelBuilder<true>
Set the model to claude-3-opus-20240229
Sourcepub fn with_claude_3_sonnet(self) -> AnthropicCompatibleChatModelBuilder<true>
pub fn with_claude_3_sonnet(self) -> AnthropicCompatibleChatModelBuilder<true>
Set the model to claude-3-sonnet-20240229
Sourcepub fn with_claude_3_haiku(self) -> AnthropicCompatibleChatModelBuilder<true>
pub fn with_claude_3_haiku(self) -> AnthropicCompatibleChatModelBuilder<true>
Set the model to claude-3-haiku-20240307
Sourcepub fn with_client(self, client: AnthropicCompatibleClient) -> Self
pub fn with_client(self, client: AnthropicCompatibleClient) -> Self
Set the client used to make requests to the Anthropic API.
Source§impl AnthropicCompatibleChatModelBuilder<true>
impl AnthropicCompatibleChatModelBuilder<true>
Sourcepub fn build(self) -> AnthropicCompatibleChatModel
pub fn build(self) -> AnthropicCompatibleChatModel
Build the model.
Trait Implementations§
Source§impl<const WITH_NAME: bool> Debug for AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Debug for AnthropicCompatibleChatModelBuilder<WITH_NAME>
Source§impl<const WITH_NAME: bool> Default for AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Default for AnthropicCompatibleChatModelBuilder<WITH_NAME>
Source§fn default() -> AnthropicCompatibleChatModelBuilder<WITH_NAME>
fn default() -> AnthropicCompatibleChatModelBuilder<WITH_NAME>
Returns the “default value” for a type. Read more
Source§impl ModelBuilder for AnthropicCompatibleChatModelBuilder<true>
impl ModelBuilder for AnthropicCompatibleChatModelBuilder<true>
Source§type Model = AnthropicCompatibleChatModel
type Model = AnthropicCompatibleChatModel
The model that this trait creates.
Source§type Error = Infallible
type Error = Infallible
An error that can occur when creating the model.
Source§async fn start_with_loading_handler(
self,
_: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static,
) -> Result<Self::Model, Self::Error>
async fn start_with_loading_handler( self, _: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static, ) -> Result<Self::Model, Self::Error>
Start the model with a loading handler.
Source§fn requires_download(&self) -> bool
fn requires_download(&self) -> bool
Check if the model will need to be downloaded before use (default: false)
Auto Trait Implementations§
impl<const WITH_NAME: bool> !Freeze for AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> !RefUnwindSafe for AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Send for AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Sync for AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Unpin for AnthropicCompatibleChatModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> !UnwindSafe for AnthropicCompatibleChatModelBuilder<WITH_NAME>
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