pub struct OpenAiDriver { /* private fields */ }Expand description
OpenAI-compatible driver — works for OpenAI, DeepSeek, Moonshot, Zhipu, etc.
Implementations§
Source§impl OpenAiDriver
impl OpenAiDriver
Trait Implementations§
Source§impl Debug for OpenAiDriver
impl Debug for OpenAiDriver
Source§impl ProviderDriver for OpenAiDriver
impl ProviderDriver for OpenAiDriver
Source§fn provider_id(&self) -> &str
fn provider_id(&self) -> &str
Unique provider identifier (matches manifest
id).Source§fn build_request(
&self,
messages: &[Message],
model: &str,
temperature: Option<f64>,
max_tokens: Option<u32>,
stream: bool,
extra: Option<&Value>,
) -> Result<DriverRequest, Error>
fn build_request( &self, messages: &[Message], model: &str, temperature: Option<f64>, max_tokens: Option<u32>, stream: bool, extra: Option<&Value>, ) -> Result<DriverRequest, Error>
Build a provider-specific HTTP request from unified parameters.
Source§fn parse_response(&self, body: &Value) -> Result<DriverResponse, Error>
fn parse_response(&self, body: &Value) -> Result<DriverResponse, Error>
Parse a non-streaming response into unified format.
Source§fn parse_stream_event(
&self,
data: &str,
) -> Result<Option<StreamingEvent>, Error>
fn parse_stream_event( &self, data: &str, ) -> Result<Option<StreamingEvent>, Error>
Parse a single streaming event from raw SSE/NDJSON data.
Source§fn supported_capabilities(&self) -> &[Capability]
fn supported_capabilities(&self) -> &[Capability]
Get the list of capabilities this driver supports.
Source§fn is_stream_done(&self, data: &str) -> bool
fn is_stream_done(&self, data: &str) -> bool
Check if the done signal has been received in streaming.
Auto Trait Implementations§
impl Freeze for OpenAiDriver
impl RefUnwindSafe for OpenAiDriver
impl Send for OpenAiDriver
impl Sync for OpenAiDriver
impl Unpin for OpenAiDriver
impl UnsafeUnpin for OpenAiDriver
impl UnwindSafe for OpenAiDriver
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