fix(client)!: update ModelListData struct following API changes

BREAKING CHANGE: `v1::model_list::ModelListData` struct has been updated.
This commit is contained in:
Ivan Gabriele
2024-08-22 01:09:23 +02:00
parent 9bfbf2e9dc
commit 2114916941

View File

@@ -9,6 +9,7 @@ pub struct ModelListResponse {
pub data: Vec<ModelListData>, pub data: Vec<ModelListData>,
} }
/// See: https://docs.mistral.ai/api/#tag/models
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ModelListData { pub struct ModelListData {
pub id: String, pub id: String,
@@ -16,27 +17,21 @@ pub struct ModelListData {
/// Unix timestamp (in seconds). /// Unix timestamp (in seconds).
pub created: u32, pub created: u32,
pub owned_by: String, pub owned_by: String,
pub permission: Vec<ModelListDataPermission>, pub root: Option<String>,
// TODO Check this prop (seen in API responses but undocumented). pub archived: bool,
// pub root: ???, pub name: String,
// TODO Check this prop (seen in API responses but undocumented). pub description: String,
// pub parent: ???, 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)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ModelListDataPermission { pub struct ModelListDataCapabilies {
pub id: String, pub completion_chat: bool,
pub object: String, pub completion_fim: bool,
/// Unix timestamp (in seconds). pub function_calling: bool,
pub created: u32, pub fine_tuning: bool,
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: ???,
} }