pub struct AnthropicMessagesModel { /* private fields */ }
Implementations§
Source§impl AnthropicMessagesModel
impl AnthropicMessagesModel
pub fn new(config: AnthropicConfig) -> Result<AnthropicMessagesModel, Error>
Trait Implementations§
Source§impl LanguageModel for AnthropicMessagesModel
impl LanguageModel for AnthropicMessagesModel
Source§fn generate<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
AnthropicMessagesModel: 'async_trait,
fn generate<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
AnthropicMessagesModel: 'async_trait,
Generate a complete response (non-streaming)
Source§fn generate_stream<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamChunk, Error>> + Send>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn generate_stream<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<StreamChunk, Error>> + Send>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Generate a streaming response
Default implementation falls back to non-streaming generate()
Auto Trait Implementations§
impl Freeze for AnthropicMessagesModel
impl !RefUnwindSafe for AnthropicMessagesModel
impl Send for AnthropicMessagesModel
impl Sync for AnthropicMessagesModel
impl Unpin for AnthropicMessagesModel
impl !UnwindSafe for AnthropicMessagesModel
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.