pub struct MistralAdapter { /* private fields */ }Expand description
Adapter for the Mistral AI Chat Completions API.
Mistral uses an OpenAI-compatible format but with slight differences
in how tool calls are structured (e.g., type field may be absent
in tool call responses, and arguments may be a JSON object instead
of a string).
Implementations§
Trait Implementations§
Source§impl Clone for MistralAdapter
impl Clone for MistralAdapter
Source§fn clone(&self) -> MistralAdapter
fn clone(&self) -> MistralAdapter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MistralAdapter
impl Debug for MistralAdapter
Source§impl Default for MistralAdapter
impl Default for MistralAdapter
Source§impl ProviderAdapter for MistralAdapter
impl ProviderAdapter for MistralAdapter
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Provider identifier (e.g., “openai”, “anthropic”).
Source§fn convert_request(&self, payload: Value) -> Value
fn convert_request(&self, payload: Value) -> Value
Convert an internal Chat Completions payload to provider-specific format. Read more
Source§fn convert_response(&self, response: Value) -> Value
fn convert_response(&self, response: Value) -> Value
Convert a provider-specific response back to Chat Completions format. Read more
Source§fn extra_headers(&self) -> Vec<(String, String)>
fn extra_headers(&self) -> Vec<(String, String)>
Get required headers for this provider (e.g., api-version, anthropic-version).
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Whether this adapter supports streaming responses.
Source§fn enable_streaming(&self, _payload: &mut Value)
fn enable_streaming(&self, _payload: &mut Value)
Add streaming parameters to the request payload. Read more
Source§fn streaming_url(&self, base_url: &str) -> Option<String>
fn streaming_url(&self, base_url: &str) -> Option<String>
Get the streaming API URL, if different from the regular API URL. Read more
Source§fn parse_stream_event(
&self,
_event_type: &str,
_data: &Value,
) -> Option<StreamEvent>
fn parse_stream_event( &self, _event_type: &str, _data: &Value, ) -> Option<StreamEvent>
Parse a single SSE event into a stream event. 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 UnsafeUnpin 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