pub struct Client<C>where
C: Config,{ /* private fields */ }
Expand description
Client is a container for config, backoff and http_client used to make API calls.
Implementations§
Source§impl Client<OpenAIConfig>
impl Client<OpenAIConfig>
Sourcepub fn new() -> Client<OpenAIConfig>
pub fn new() -> Client<OpenAIConfig>
Client with default OpenAIConfig
Source§impl<C> Client<C>where
C: Config,
impl<C> Client<C>where
C: Config,
Sourcepub fn build(
http_client: Client,
config: C,
backoff: ExponentialBackoff<SystemClock>,
) -> Client<C>
pub fn build( http_client: Client, config: C, backoff: ExponentialBackoff<SystemClock>, ) -> Client<C>
Create client with a custom HTTP client, OpenAI config, and backoff.
Sourcepub fn with_config(config: C) -> Client<C>
pub fn with_config(config: C) -> Client<C>
Create client with OpenAIConfig or crate::config::AzureConfig
Sourcepub fn with_http_client(self, http_client: Client) -> Client<C>
pub fn with_http_client(self, http_client: Client) -> Client<C>
Provide your own client to make HTTP requests with.
Sourcepub fn with_backoff(self, backoff: ExponentialBackoff<SystemClock>) -> Client<C>
pub fn with_backoff(self, backoff: ExponentialBackoff<SystemClock>) -> Client<C>
Exponential backoff for retrying rate limited requests.
Sourcepub fn completions(&self) -> Completions<'_, C>
pub fn completions(&self) -> Completions<'_, C>
To call Completions group related APIs using this client.
Sourcepub fn moderations(&self) -> Moderations<'_, C>
pub fn moderations(&self) -> Moderations<'_, C>
To call Moderations group related APIs using this client.
Sourcepub fn fine_tuning(&self) -> FineTuning<'_, C>
pub fn fine_tuning(&self) -> FineTuning<'_, C>
To call FineTuning group related APIs using this client.
Sourcepub fn embeddings(&self) -> Embeddings<'_, C>
pub fn embeddings(&self) -> Embeddings<'_, C>
To call Embeddings group related APIs using this client.
Sourcepub fn assistants(&self) -> Assistants<'_, C>
pub fn assistants(&self) -> Assistants<'_, C>
To call Assistants group related APIs using this client.
Sourcepub fn vector_stores(&self) -> VectorStores<'_, C>
pub fn vector_stores(&self) -> VectorStores<'_, C>
To call VectorStores group related APIs using this client.
Sourcepub fn audit_logs(&self) -> AuditLogs<'_, C>
pub fn audit_logs(&self) -> AuditLogs<'_, C>
To call AuditLogs group related APIs using this client.
Sourcepub fn projects(&self) -> Projects<'_, C>
pub fn projects(&self) -> Projects<'_, C>
To call Projects group related APIs using this client.
Sourcepub fn responses(&self) -> Responses<'_, C>
pub fn responses(&self) -> Responses<'_, C>
To call Responses group related APIs using this client.
pub fn config(&self) -> &C
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Client<C>where
C: Freeze,
impl<C> !RefUnwindSafe for Client<C>
impl<C> Send for Client<C>
impl<C> Sync for Client<C>
impl<C> Unpin for Client<C>where
C: Unpin,
impl<C> !UnwindSafe for Client<C>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more