pub struct Client { /* private fields */ }
Expand description
Client object. Must be constructed to talk to the API.
Implementations§
Source§impl Client
impl Client
pub fn new(token: &str) -> Self
Sourcepub async fn engines(&self) -> Result<Vec<EngineInfo>, Error>
pub async fn engines(&self) -> Result<Vec<EngineInfo>, Error>
Lists the currently available engines.
Provides basic information about each one such as the owner and availability.
§Errors
Error::APIError
if the server returns an error
Sourcepub fn engines_sync(&self) -> Result<Vec<EngineInfo>, Error>
pub fn engines_sync(&self) -> Result<Vec<EngineInfo>, Error>
Lists the currently available engines.
Provides basic information about each one such as the owner and availability.
§Errors
Error::APIError
if the server returns an error
Sourcepub async fn engine(&self, engine: Engine) -> Result<EngineInfo, Error>
pub async fn engine(&self, engine: Engine) -> Result<EngineInfo, Error>
Retrieves an engine instance
Provides basic information about the engine such as the owner and availability.
§Errors
Error::APIError
if the server returns an error
pub fn engine_sync(&self, engine: Engine) -> Result<EngineInfo, Error>
Sourcepub async fn complete_prompt(
&self,
prompt: impl Into<CompletionArgs>,
) -> Result<Completion, Error>
pub async fn complete_prompt( &self, prompt: impl Into<CompletionArgs>, ) -> Result<Completion, Error>
Sourcepub fn complete_prompt_sync(
&self,
prompt: impl Into<CompletionArgs>,
) -> Result<Completion, Error>
pub fn complete_prompt_sync( &self, prompt: impl Into<CompletionArgs>, ) -> Result<Completion, Error>
Get predicted completion of the prompt synchronously
§Error
Error::APIError
if the api returns an error
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