test: update all tests for v1.0 API

- Use Model::mistral_small_latest() instead of enum variants
- Use Model::mistral_embed() instead of EmbedModel::MistralEmbed
- Use serde_json::json!() for tool parameter schemas
- Update ChatParams for Option<f32> temperature field
- Update streaming test comments for new delta.content type
This commit is contained in:
2026-03-20 17:57:44 +00:00
parent 4d6eca62ef
commit ce96bcfeeb
6 changed files with 65 additions and 72 deletions

View File

@@ -1,11 +1,11 @@
use jrest::expect;
use mistralai_client::v1::{client::Client, constants::EmbedModel};
use mistralai_client::v1::{client::Client, constants::Model};
#[tokio::test]
async fn test_client_embeddings_async() {
let client: Client = Client::new(None, None, None, None).unwrap();
let model = EmbedModel::MistralEmbed;
let model = Model::mistral_embed();
let input = vec!["Embed this sentence.", "As well as this one."]
.iter()
.map(|s| s.to_string())
@@ -17,7 +17,6 @@ async fn test_client_embeddings_async() {
.await
.unwrap();
expect!(response.model).to_be(EmbedModel::MistralEmbed);
expect!(response.object).to_be("list".to_string());
expect!(response.data.len()).to_be(2);
expect!(response.data[0].index).to_be(0);