pub struct OpenAiCompatibleClient { /* private fields */ }Implementations§
Source§impl OpenAiCompatibleClient
impl OpenAiCompatibleClient
pub fn from_config(config: OpenAiCompatibleConfig) -> Result<Self>
pub async fn chat_completion( &self, request: &ChatCompletionRequest, ) -> Result<ChatCompletionResponse>
pub async fn chat_completion_stream( &self, request: &ChatCompletionRequest, ) -> Result<ChatStream>
pub async fn request_json<T, R>( &self, method: Method, path: &str, body: Option<&T>, ) -> Result<R>
Trait Implementations§
Source§impl ChatProvider for OpenAiCompatibleClient
impl ChatProvider for OpenAiCompatibleClient
fn name(&self) -> &str
fn capabilities(&self) -> ProviderCapabilities
fn complete<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Clone for OpenAiCompatibleClient
impl Clone for OpenAiCompatibleClient
Source§fn clone(&self) -> OpenAiCompatibleClient
fn clone(&self) -> OpenAiCompatibleClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OpenAiCompatibleClient
impl !UnwindSafe for OpenAiCompatibleClient
impl Freeze for OpenAiCompatibleClient
impl Send for OpenAiCompatibleClient
impl Sync for OpenAiCompatibleClient
impl Unpin for OpenAiCompatibleClient
impl UnsafeUnpin for OpenAiCompatibleClient
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