pub struct OpenAiClient { /* private fields */ }
Implementations§
Source§impl OpenAiClient
impl OpenAiClient
pub fn new(api_key: &str, profile: ClientProfile) -> OpenAiClient
pub async fn completion( &self, model: ModelId, prompt: &str, max_tokens: u16, ) -> Result<String, Error>
pub async fn chat( &self, model: ModelId, max_tokens: u16, messages: Vec<ChatMessage>, ) -> Result<ChatMessage, GptError>
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