pub struct Client<C: Config> { /* private fields */ }_api only.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() -> Self
pub fn new() -> Self
Client with default OpenAIConfig
Source§impl<C: Config> Client<C>
impl<C: Config> Client<C>
Sourcepub fn build(
http_client: Client,
config: C,
backoff: ExponentialBackoff,
) -> Self
pub fn build( http_client: Client, config: C, backoff: ExponentialBackoff, ) -> Self
Create client with a custom HTTP client, OpenAI config, and backoff.
Sourcepub fn with_config(config: C) -> Self
pub fn with_config(config: C) -> Self
Create client with OpenAIConfig or crate::config::AzureConfig
Sourcepub fn with_http_client(self, http_client: Client) -> Self
pub fn with_http_client(self, http_client: Client) -> Self
Provide your own client to make HTTP requests with.
Sourcepub fn with_backoff(self, backoff: ExponentialBackoff) -> Self
pub fn with_backoff(self, backoff: ExponentialBackoff) -> Self
Exponential backoff for retrying rate limited requests.
Sourcepub fn models(&self) -> Models<'_, C>
Available on crate feature model only.
pub fn models(&self) -> Models<'_, C>
model only.To call Models group related APIs using this client.
Sourcepub fn completions(&self) -> Completions<'_, C>
Available on crate feature completions only.
pub fn completions(&self) -> Completions<'_, C>
completions only.To call Completions group related APIs using this client.
Sourcepub fn chat(&self) -> Chat<'_, C>
Available on crate feature chat-completion only.
pub fn chat(&self) -> Chat<'_, C>
chat-completion only.To call Chat group related APIs using this client.
Sourcepub fn images(&self) -> Images<'_, C>
Available on crate feature image only.
pub fn images(&self) -> Images<'_, C>
image only.To call Images group related APIs using this client.
Sourcepub fn moderations(&self) -> Moderations<'_, C>
Available on crate feature moderation only.
pub fn moderations(&self) -> Moderations<'_, C>
moderation only.To call Moderations group related APIs using this client.
Sourcepub fn files(&self) -> Files<'_, C>
Available on crate feature file only.
pub fn files(&self) -> Files<'_, C>
file only.To call Files group related APIs using this client.
Sourcepub fn uploads(&self) -> Uploads<'_, C>
Available on crate feature upload only.
pub fn uploads(&self) -> Uploads<'_, C>
upload only.To call Uploads group related APIs using this client.
Sourcepub fn fine_tuning(&self) -> FineTuning<'_, C>
Available on crate feature finetuning only.
pub fn fine_tuning(&self) -> FineTuning<'_, C>
finetuning only.To call FineTuning group related APIs using this client.
Sourcepub fn embeddings(&self) -> Embeddings<'_, C>
Available on crate feature embedding only.
pub fn embeddings(&self) -> Embeddings<'_, C>
embedding only.To call Embeddings group related APIs using this client.
Sourcepub fn audio(&self) -> Audio<'_, C>
Available on crate feature audio only.
pub fn audio(&self) -> Audio<'_, C>
audio only.To call Audio group related APIs using this client.
Sourcepub fn videos(&self) -> Videos<'_, C>
Available on crate feature video only.
pub fn videos(&self) -> Videos<'_, C>
video only.To call Videos group related APIs using this client.
Sourcepub fn assistants(&self) -> Assistants<'_, C>
Available on crate feature assistant only.
pub fn assistants(&self) -> Assistants<'_, C>
assistant only.To call Assistants group related APIs using this client.
Sourcepub fn threads(&self) -> Threads<'_, C>
Available on crate feature assistant only.
pub fn threads(&self) -> Threads<'_, C>
assistant only.To call Threads group related APIs using this client.
Sourcepub fn vector_stores(&self) -> VectorStores<'_, C>
Available on crate feature vectorstore only.
pub fn vector_stores(&self) -> VectorStores<'_, C>
vectorstore only.To call VectorStores group related APIs using this client.
Sourcepub fn batches(&self) -> Batches<'_, C>
Available on crate feature batch only.
pub fn batches(&self) -> Batches<'_, C>
batch only.To call Batches group related APIs using this client.
Sourcepub fn admin(&self) -> Admin<'_, C>
Available on crate feature administration only.
pub fn admin(&self) -> Admin<'_, C>
administration only.To call Admin group related APIs using this client. This groups together admin API keys, invites, users, projects, audit logs, and certificates.
Sourcepub fn responses(&self) -> Responses<'_, C>
Available on crate feature responses only.
pub fn responses(&self) -> Responses<'_, C>
responses only.To call Responses group related APIs using this client.
Sourcepub fn conversations(&self) -> Conversations<'_, C>
Available on crate feature responses only.
pub fn conversations(&self) -> Conversations<'_, C>
responses only.To call Conversations group related APIs using this client.
Sourcepub fn containers(&self) -> Containers<'_, C>
Available on crate feature container only.
pub fn containers(&self) -> Containers<'_, C>
container only.To call Containers group related APIs using this client.
Sourcepub fn evals(&self) -> Evals<'_, C>
Available on crate feature evals only.
pub fn evals(&self) -> Evals<'_, C>
evals only.To call Evals group related APIs using this client.
pub fn chatkit(&self) -> Chatkit<'_, C>
chatkit only.Sourcepub fn realtime(&self) -> Realtime<'_, C>
Available on crate feature realtime only.
pub fn realtime(&self) -> Realtime<'_, C>
realtime only.To call Realtime group related APIs using this client.