Struct rusty_openai::openai_api::client::ClientApi
source · pub struct ClientApi<'a> { /* private fields */ }
Expand description
ClientApi struct to interact with the models endpoint of the API.
Implementations§
source§impl<'a> ClientApi<'a>
impl<'a> ClientApi<'a>
sourcepub fn new(client: &'a RequestClient, base_url: &'a str) -> Self
pub fn new(client: &'a RequestClient, base_url: &'a str) -> Self
Create a new instance of ClientApi.
sourcepub async fn get_models(&self) -> Result<Value, OpenAIError>
pub async fn get_models(&self) -> Result<Value, OpenAIError>
Fetch the list of available models from the API.
§Returns
A Result containing the JSON response as serde_json::Value
on success,
or an OpenAIError on failure.
Auto Trait Implementations§
impl<'a> Freeze for ClientApi<'a>
impl<'a> !RefUnwindSafe for ClientApi<'a>
impl<'a> Send for ClientApi<'a>
impl<'a> Sync for ClientApi<'a>
impl<'a> Unpin for ClientApi<'a>
impl<'a> !UnwindSafe for ClientApi<'a>
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