pub struct Client<C: Config> { /* private fields */ }
Expand description
Client is a container for config 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) -> Self
pub fn build(http_client: Client, config: C) -> Self
Create client with a custom HTTP client, OpenAI config
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 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.