pub struct OpenAIClient { /* private fields */ }
Expand description
The client to send the OpenAI API requests.
Implementations§
Source§impl OpenAIClient
impl OpenAIClient
Sourcepub fn new(key: Key, organization: Option<Organization>) -> Self
pub fn new(key: Key, organization: Option<Organization>) -> Self
Create a new client.
Sourcepub async fn send(&self, request: OpenAIRequest) -> Result<Response>
pub async fn send(&self, request: OpenAIRequest) -> Result<Response>
Send a request to the OpenAI API and receive the response.
Auto Trait Implementations§
impl Freeze for OpenAIClient
impl RefUnwindSafe for OpenAIClient
impl Send for OpenAIClient
impl Sync for OpenAIClient
impl Unpin for OpenAIClient
impl UnwindSafe for OpenAIClient
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