pub struct OpenAIProvider { /* private fields */ }
Implementations§
Source§impl OpenAIProvider
impl OpenAIProvider
pub fn new(config: OpenAIConfig) -> Self
Trait Implementations§
Source§impl Clone for OpenAIProvider
impl Clone for OpenAIProvider
Source§fn clone(&self) -> OpenAIProvider
fn clone(&self) -> OpenAIProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OpenAIProvider
impl Debug for OpenAIProvider
Source§impl Default for OpenAIProvider
impl Default for OpenAIProvider
Source§fn default() -> OpenAIProvider
fn default() -> OpenAIProvider
Returns the “default value” for a type. Read more
Source§impl Provider for OpenAIProvider
impl Provider for OpenAIProvider
type Config = OpenAIConfig
type ChatRequest = ChatRequest
type ChatResponse = ChatResponse
type ChatResponseStream = ChatResponseStream
fn config(&self) -> &Self::Config
fn chat<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 (impl 'async_trait + HttpClient),
request: Self::ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<Self::ChatResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn chat_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 (impl 'async_trait + HttpClient),
request: Self::ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Self::ChatResponseStream, Error>> + Send>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn completions<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 (impl 'async_trait + HttpClient),
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<CompletionResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for OpenAIProvider
impl RefUnwindSafe for OpenAIProvider
impl Send for OpenAIProvider
impl Sync for OpenAIProvider
impl Unpin for OpenAIProvider
impl UnwindSafe 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