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.
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>where
C: Send,
impl<C> Sync for Client<C>where
C: Sync,
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
Mutably borrows from an owned value. Read more