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>
Sourcepub fn new() -> AnthropicCompatibleChatModelBuilder<false>
pub fn new() -> AnthropicCompatibleChatModelBuilder<false>
Creates a new builder
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,
) -> AnthropicCompatibleChatModelBuilder<WITH_NAME>
pub fn with_max_tokens( self, max_tokens: u32, ) -> AnthropicCompatibleChatModelBuilder<WITH_NAME>
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,
) -> AnthropicCompatibleChatModelBuilder<WITH_NAME>
pub fn with_client( self, client: AnthropicCompatibleClient, ) -> AnthropicCompatibleChatModelBuilder<WITH_NAME>
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<<AnthropicCompatibleChatModelBuilder<true> as ModelBuilder>::Model, <AnthropicCompatibleChatModelBuilder<true> as ModelBuilder>::Error>
async fn start_with_loading_handler( self, _: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static, ) -> Result<<AnthropicCompatibleChatModelBuilder<true> as ModelBuilder>::Model, <AnthropicCompatibleChatModelBuilder<true> as ModelBuilder>::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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().