Compare commits
8 Commits
v0.12.0
...
renovate/c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c100d7e65 | ||
|
|
9ad6a1dc84 | ||
|
|
7c464830ee | ||
|
|
161b33c725 | ||
|
|
79a410b298 | ||
|
|
4a45ad337f | ||
|
|
2114916941 | ||
|
|
9bfbf2e9dc |
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||||
- name: Upload tests coverage
|
- name: Upload tests coverage
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
files: ./lcov.info
|
files: ./lcov.info
|
||||||
|
|||||||
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,3 +1,18 @@
|
|||||||
|
## [0.14.0](https://github.com/ivangabriele/mistralai-client-rs/compare/v0.13.0...v) (2024-08-27)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **constants:** update model constants ([#17](https://github.com/ivangabriele/mistralai-client-rs/issues/17)) ([161b33c](https://github.com/ivangabriele/mistralai-client-rs/commit/161b33c72539a6e982207349942a436df95399b7))
|
||||||
|
## [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
|
||||||
|
|||||||
@@ -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.14.0"
|
||||||
|
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.76.0"
|
rust-version = "1.76.0"
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -10,16 +10,22 @@ pub enum Model {
|
|||||||
OpenMixtral8x7b,
|
OpenMixtral8x7b,
|
||||||
#[serde(rename = "open-mixtral-8x22b")]
|
#[serde(rename = "open-mixtral-8x22b")]
|
||||||
OpenMixtral8x22b,
|
OpenMixtral8x22b,
|
||||||
|
#[serde(rename = "open-mistral-nemo", alias = "open-mistral-nemo-2407")]
|
||||||
|
OpenMistralNemo,
|
||||||
#[serde(rename = "mistral-tiny")]
|
#[serde(rename = "mistral-tiny")]
|
||||||
MistralTiny,
|
MistralTiny,
|
||||||
#[serde(rename = "mistral-small-latest")]
|
#[serde(rename = "mistral-small-latest", alias = "mistral-small-2402")]
|
||||||
MistralSmallLatest,
|
MistralSmallLatest,
|
||||||
#[serde(rename = "mistral-medium-latest")]
|
#[serde(rename = "mistral-medium-latest", alias = "mistral-medium-2312")]
|
||||||
MistralMediumLatest,
|
MistralMediumLatest,
|
||||||
#[serde(rename = "mistral-large-latest")]
|
#[serde(rename = "mistral-large-latest", alias = "mistral-large-2407")]
|
||||||
MistralLargeLatest,
|
MistralLargeLatest,
|
||||||
#[serde(rename = "codestral-latest")]
|
#[serde(rename = "mistral-large-2402")]
|
||||||
|
MistralLarge,
|
||||||
|
#[serde(rename = "codestral-latest", alias = "codestral-2405")]
|
||||||
CodestralLatest,
|
CodestralLatest,
|
||||||
|
#[serde(rename = "open-codestral-mamba")]
|
||||||
|
CodestralMamba,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
|
||||||
|
|||||||
@@ -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: ???,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,14 @@ fn test_model_constant() {
|
|||||||
Model::OpenMistral7b,
|
Model::OpenMistral7b,
|
||||||
Model::OpenMixtral8x7b,
|
Model::OpenMixtral8x7b,
|
||||||
Model::OpenMixtral8x22b,
|
Model::OpenMixtral8x22b,
|
||||||
|
Model::OpenMistralNemo,
|
||||||
Model::MistralTiny,
|
Model::MistralTiny,
|
||||||
Model::MistralSmallLatest,
|
Model::MistralSmallLatest,
|
||||||
Model::MistralMediumLatest,
|
Model::MistralMediumLatest,
|
||||||
Model::MistralLargeLatest,
|
Model::MistralLargeLatest,
|
||||||
|
Model::MistralLarge,
|
||||||
Model::CodestralLatest,
|
Model::CodestralLatest,
|
||||||
|
Model::CodestralMamba,
|
||||||
];
|
];
|
||||||
|
|
||||||
let client = Client::new(None, None, None, None).unwrap();
|
let client = Client::new(None, None, None, None).unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user