Skip to content

Commit

Permalink
fix(client)!: update ModelListData struct following API changes
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `v1::model_list::ModelListData` struct has been updated.
  • Loading branch information
ivangabriele committed Aug 21, 2024
1 parent 9bfbf2e commit 2114916
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions src/v1/model_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,29 @@ pub struct ModelListResponse {
pub data: Vec<ModelListData>,
}

/// See: https://docs.mistral.ai/api/#tag/models
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ModelListData {
pub id: String,
pub object: String,
/// Unix timestamp (in seconds).
pub created: u32,
pub owned_by: String,
pub permission: Vec<ModelListDataPermission>,
// TODO Check this prop (seen in API responses but undocumented).
// pub root: ???,
// TODO Check this prop (seen in API responses but undocumented).
// pub parent: ???,
pub root: Option<String>,
pub archived: bool,
pub name: String,
pub description: String,
pub capabilities: ModelListDataCapabilies,
pub max_context_length: u32,
pub aliases: Vec<String>,
/// ISO 8601 date (`YYYY-MM-DDTHH:MM:SSZ`).
pub deprecation: Option<String>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ModelListDataPermission {
pub id: String,
pub object: String,
/// Unix timestamp (in seconds).
pub created: u32,
pub allow_create_engine: bool,
pub allow_sampling: bool,
pub allow_logprobs: bool,
pub allow_search_indices: bool,
pub allow_view: bool,
pub allow_fine_tuning: bool,
pub organization: String,
pub is_blocking: bool,
// TODO Check this prop (seen in API responses but undocumented).
// pub group: ???,
pub struct ModelListDataCapabilies {
pub completion_chat: bool,
pub completion_fim: bool,
pub function_calling: bool,
pub fine_tuning: bool,
}

0 comments on commit 2114916

Please sign in to comment.