pub struct Client {
pub client: Client,
/* private fields */
}
Expand description
An open ai client
Fields§
§client: Client
The inner http client
Implementations§
source§impl Client
impl Client
sourcepub async fn completion(
&self,
model: &str,
max_tokens: u16,
prompt: &str
) -> Result<CompletionResponse, Error>
pub async fn completion( &self, model: &str, max_tokens: u16, prompt: &str ) -> Result<CompletionResponse, Error>
Perform a completion.
sourcepub async fn chat_completion(
&self,
model: &str,
messages: &[ChatMessage],
max_tokens: Option<u16>
) -> Result<ChatCompletionResponse, Error>
pub async fn chat_completion( &self, model: &str, messages: &[ChatMessage], max_tokens: Option<u16> ) -> Result<ChatCompletionResponse, Error>
Perform a chat completion.
Trait Implementations§
Auto Trait Implementations§
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