pub struct MistralModel { /* private fields */ }Expand description
Mistral AI model provider.
Implementations§
Source§impl MistralModel
impl MistralModel
pub fn new(config: MistralConfig) -> Self
Trait Implementations§
Source§impl Model for MistralModel
impl Model for MistralModel
Source§fn config(&self) -> &ModelConfig
fn config(&self) -> &ModelConfig
Returns the model configuration.
Source§fn update_config(&mut self, config: ModelConfig)
fn update_config(&mut self, config: ModelConfig)
Updates the model configuration.
Source§fn stream<'a>(
&'a self,
messages: &'a [Message],
tool_specs: Option<&'a [ToolSpec]>,
system_prompt: Option<&'a str>,
_tool_choice: Option<ToolChoice>,
_system_prompt_content: Option<&'a [SystemContentBlock]>,
) -> StreamEventStream<'a>
fn stream<'a>( &'a self, messages: &'a [Message], tool_specs: Option<&'a [ToolSpec]>, system_prompt: Option<&'a str>, _tool_choice: Option<ToolChoice>, _system_prompt_content: Option<&'a [SystemContentBlock]>, ) -> StreamEventStream<'a>
Streams a response from the model.
Auto Trait Implementations§
impl Freeze for MistralModel
impl !RefUnwindSafe for MistralModel
impl Send for MistralModel
impl Sync for MistralModel
impl Unpin for MistralModel
impl !UnwindSafe for MistralModel
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreCreates a shared type from an unshared type.
Source§impl<T> ModelExt for Twhere
T: Model,
impl<T> ModelExt for Twhere
T: Model,
Source§fn structured_output<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
messages: &'life1 [Message],
system_prompt: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<T, StrandsError>> + Send + 'async_trait>>where
T: DeserializeOwned + JsonSchema + Send + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn structured_output<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
messages: &'life1 [Message],
system_prompt: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<T, StrandsError>> + Send + 'async_trait>>where
T: DeserializeOwned + JsonSchema + Send + 'async_trait,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Generates a structured output from the model.