pub struct MistralAdapter { /* private fields */ }
Expand description
Mistral adapter (conservative HTTP implementation).
Note: Mistral provides an official Rust SDK (https://github.com/ivangabriele/mistralai-client-rs). We keep this implementation HTTP-based for now and can swap to the SDK later.
Implementations§
Source§impl MistralAdapter
impl MistralAdapter
pub fn new() -> Result<Self, AiLibError>
Sourcepub fn with_transport(
transport: DynHttpTransportRef,
api_key: Option<String>,
base_url: String,
) -> Result<Self, AiLibError>
pub fn with_transport( transport: DynHttpTransportRef, api_key: Option<String>, base_url: String, ) -> Result<Self, AiLibError>
Construct using an injected object-safe transport reference (for testing/SDKs)
Trait Implementations§
Source§impl ChatApi for MistralAdapter
impl ChatApi for MistralAdapter
Source§fn chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, AiLibError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, AiLibError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send chat completion request Read more
Source§fn chat_completion_stream<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<ChatCompletionChunk, AiLibError>> + Send + Unpin>, AiLibError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat_completion_stream<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<ChatCompletionChunk, AiLibError>> + Send + Unpin>, AiLibError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streaming chat completion request Read more
Auto Trait Implementations§
impl Freeze for MistralAdapter
impl !RefUnwindSafe for MistralAdapter
impl Send for MistralAdapter
impl Sync for MistralAdapter
impl Unpin for MistralAdapter
impl !UnwindSafe for MistralAdapter
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