Struct async_openai_wasm::Client
source · pub struct Client { /* private fields */ }
Expand description
Client is a container for config, backoff and http_client used to make API calls.
Implementations§
source§impl Client
impl Client
sourcepub fn build<C: Config>(http_client: Client, config: C) -> Self
pub fn build<C: Config>(http_client: Client, config: C) -> Self
Create client with a custom HTTP client, OpenAI config, and backoff.
sourcepub fn with_config<C: Config>(config: C) -> Self
pub fn with_config<C: 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<'_>
pub fn completions(&self) -> Completions<'_>
To call Completions group related APIs using this client.
sourcepub fn moderations(&self) -> Moderations<'_>
pub fn moderations(&self) -> Moderations<'_>
To call Moderations group related APIs using this client.
sourcepub fn fine_tuning(&self) -> FineTuning<'_>
pub fn fine_tuning(&self) -> FineTuning<'_>
To call FineTuning group related APIs using this client.
sourcepub fn embeddings(&self) -> Embeddings<'_>
pub fn embeddings(&self) -> Embeddings<'_>
To call Embeddings group related APIs using this client.
sourcepub fn assistants(&self) -> Assistants<'_>
pub fn assistants(&self) -> Assistants<'_>
To call Assistants group related APIs using this client.
pub fn config(&self) -> &Rc<dyn Config>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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