pub struct OpenAiCompatClient { /* private fields */ }Implementations§
Source§impl OpenAiCompatClient
impl OpenAiCompatClient
pub fn new(api_key: impl Into<String>, config: OpenAiCompatConfig) -> Self
pub fn from_env(config: OpenAiCompatConfig) -> Result<Self, ApiError>
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_retry_policy(self, retry: RetryPolicy) -> Self
pub async fn send_message( &self, request: &MessageRequest, ) -> Result<MessageResponse, ApiError>
pub async fn stream_message( &self, request: &MessageRequest, ) -> Result<MessageStream, ApiError>
Trait Implementations§
Source§impl Clone for OpenAiCompatClient
impl Clone for OpenAiCompatClient
Source§fn clone(&self) -> OpenAiCompatClient
fn clone(&self) -> OpenAiCompatClient
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for OpenAiCompatClient
impl !RefUnwindSafe for OpenAiCompatClient
impl Send for OpenAiCompatClient
impl Sync for OpenAiCompatClient
impl Unpin for OpenAiCompatClient
impl UnsafeUnpin for OpenAiCompatClient
impl !UnwindSafe for OpenAiCompatClient
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