pub struct OpenAIProvider { /* private fields */ }Implementations§
Source§impl OpenAIProvider
impl OpenAIProvider
pub fn new(cfg: ProviderConfig) -> Self
Trait Implementations§
Source§impl Provider for OpenAIProvider
impl Provider for OpenAIProvider
fn name(&self) -> &str
fn config(&self) -> &ProviderConfig
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<StreamChunk, ProviderError>>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stream<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<StreamChunk, ProviderError>>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Streaming variant. The default falls back to
complete() and emits
the whole response as one SSE chunk; natively streaming providers
override this.Auto Trait Implementations§
impl !RefUnwindSafe for OpenAIProvider
impl !UnwindSafe for OpenAIProvider
impl Freeze for OpenAIProvider
impl Send for OpenAIProvider
impl Sync for OpenAIProvider
impl Unpin for OpenAIProvider
impl UnsafeUnpin for OpenAIProvider
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