pub struct Client { /* private fields */ }Expand description
OpenAI API client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder<()>
pub fn builder() -> ClientBuilder<()>
Create a new client builder.
Sourcepub async fn create_chat_completion(
&self,
request: CreateChatCompletionRequest,
) -> Result<CreateChatCompletionResponse>
pub async fn create_chat_completion( &self, request: CreateChatCompletionRequest, ) -> Result<CreateChatCompletionResponse>
Create a chat completion.
Sourcepub async fn list_models(&self) -> Result<ModelList>
pub async fn list_models(&self) -> Result<ModelList>
List available models.
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