pub struct ModelsApi { /* private fields */ }Expand description
Models API for listing available models.
Implementations§
Source§impl ModelsApi
impl ModelsApi
Sourcepub async fn list(&self) -> Result<ModelListResponse>
pub async fn list(&self) -> Result<ModelListResponse>
List all available models.
§Example
use xai_rust::XaiClient;
let client = XaiClient::from_env()?;
let models = client.models().list().await?;
for model in models.data {
println!("{}: {}", model.id, model.owned_by);
}Sourcepub async fn language_models(&self) -> Result<ModelListResponse>
pub async fn language_models(&self) -> Result<ModelListResponse>
List all available language models.
Sourcepub async fn language_model(&self, model_id: &str) -> Result<Model>
pub async fn language_model(&self, model_id: &str) -> Result<Model>
Get a specific language model by ID.
Sourcepub async fn embedding_models(&self) -> Result<ModelListResponse>
pub async fn embedding_models(&self) -> Result<ModelListResponse>
List all available embedding models.
Sourcepub async fn embedding_model(&self, model_id: &str) -> Result<Model>
pub async fn embedding_model(&self, model_id: &str) -> Result<Model>
Get a specific embedding model by ID.
Sourcepub async fn image_generation_models(&self) -> Result<ModelListResponse>
pub async fn image_generation_models(&self) -> Result<ModelListResponse>
List all available image-generation models.
Sourcepub async fn image_generation_model(&self, model_id: &str) -> Result<Model>
pub async fn image_generation_model(&self, model_id: &str) -> Result<Model>
Get a specific image-generation model by ID.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelsApi
impl !RefUnwindSafe for ModelsApi
impl Send for ModelsApi
impl Sync for ModelsApi
impl Unpin for ModelsApi
impl UnsafeUnpin for ModelsApi
impl !UnwindSafe for ModelsApi
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