4 Commits

Author SHA1 Message Date
Ivan Gabriele
79a410b298 ci(release): v0.13.0 2024-08-22 01:15:08 +02:00
Ivan Gabriele
4a45ad337f docs(changelog): update 2024-08-22 01:15:00 +02:00
Ivan Gabriele
2114916941 fix(client)!: update ModelListData struct following API changes
BREAKING CHANGE: `v1::model_list::ModelListData` struct has been updated.
2024-08-22 01:09:27 +02:00
francois-caddet
9bfbf2e9dc fix(client): remove the Content-Type from the headers of the reqwest builders. (#14)
They apparently are conflicting with reqwest internal stufs.

fix #13
2024-08-22 00:45:06 +02:00
4 changed files with 26 additions and 24 deletions

View File

@@ -1,3 +1,13 @@
## [0.13.0](https://github.com/ivangabriele/mistralai-client-rs/compare/v0.12.0...v) (2024-08-21)
### ⚠ BREAKING CHANGES
* **client:** `v1::model_list::ModelListData` struct has been updated.
### Bug Fixes
* **client:** remove the `Content-Type` from the headers of the reqwest builders. ([#14](https://github.com/ivangabriele/mistralai-client-rs/issues/14)) ([9bfbf2e](https://github.com/ivangabriele/mistralai-client-rs/commit/9bfbf2e9dc7b48103ac56923fb8b3ac9a5e2d9cf)), closes [#13](https://github.com/ivangabriele/mistralai-client-rs/issues/13)
* **client:** update ModelListData struct following API changes ([2114916](https://github.com/ivangabriele/mistralai-client-rs/commit/2114916941e1ff5aa242290df5f092c0d4954afc))
## [0.12.0](https://github.com/ivangabriele/mistralai-client-rs/compare/v0.11.0...v) (2024-07-24) ## [0.12.0](https://github.com/ivangabriele/mistralai-client-rs/compare/v0.11.0...v) (2024-07-24)
### Features ### Features

View File

@@ -2,7 +2,7 @@
name = "mistralai-client" name = "mistralai-client"
description = "Mistral AI API client library for Rust (unofficial)." description = "Mistral AI API client library for Rust (unofficial)."
license = "Apache-2.0" license = "Apache-2.0"
version = "0.12.0" version = "0.13.0"
edition = "2021" edition = "2021"
rust-version = "1.76.0" rust-version = "1.76.0"

View File

@@ -384,7 +384,6 @@ impl Client {
let request_builder = request let request_builder = request
.bearer_auth(&self.api_key) .bearer_auth(&self.api_key)
.header("Accept", "application/json") .header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("User-Agent", user_agent); .header("User-Agent", user_agent);
request_builder request_builder
@@ -399,7 +398,6 @@ impl Client {
let request_builder = request let request_builder = request
.bearer_auth(&self.api_key) .bearer_auth(&self.api_key)
.header("Accept", "application/json") .header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("User-Agent", user_agent); .header("User-Agent", user_agent);
request_builder request_builder
@@ -414,7 +412,6 @@ impl Client {
let request_builder = request let request_builder = request
.bearer_auth(&self.api_key) .bearer_auth(&self.api_key)
.header("Accept", "text/event-stream") .header("Accept", "text/event-stream")
.header("Content-Type", "application/json")
.header("User-Agent", user_agent); .header("User-Agent", user_agent);
request_builder request_builder

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: ???,
} }