pub struct OpenAiProvider { /* private fields */ }Expand description
An OpenAI-compatible HTTP provider. The composition layer supplies its endpoint, credentials, and headers from runtime configuration.
Implementations§
Trait Implementations§
Source§impl Provider for OpenAiProvider
impl Provider for OpenAiProvider
Source§fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
on_delta: &'life2 (dyn for<'a> Fn(&'a str) + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<(ChatMessage, Usage), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
OpenAiProvider: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest,
on_delta: &'life2 (dyn for<'a> Fn(&'a str) + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<(ChatMessage, Usage), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
OpenAiProvider: 'async_trait,
Run one completion and return its canonical assistant message and usage.
Source§impl Provider for OpenAiProvider
impl Provider for OpenAiProvider
Source§fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ChatRequest,
on_delta: &'life2 (dyn for<'a> Fn(&'a str) + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<(ChatMessage, Usage), RuntimeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
OpenAiProvider: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ChatRequest,
on_delta: &'life2 (dyn for<'a> Fn(&'a str) + Send + Sync),
) -> Pin<Box<dyn Future<Output = Result<(ChatMessage, Usage), RuntimeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
OpenAiProvider: 'async_trait,
Run one completion.
on_delta is called with each text chunk as it
streams in. Returns the fully assembled assistant message and usage.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