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

@@ -6,26 +6,19 @@ use mistralai_client::v1::{
};
#[test]
fn test_model_constant() {
fn test_model_constants() {
let models = vec![
Model::OpenMistral7b,
Model::OpenMixtral8x7b,
Model::OpenMixtral8x22b,
Model::OpenMistralNemo,
Model::MistralTiny,
Model::MistralSmallLatest,
Model::MistralMediumLatest,
Model::MistralLargeLatest,
Model::MistralLarge,
Model::CodestralLatest,
Model::CodestralMamba,
Model::mistral_small_latest(),
Model::mistral_large_latest(),
Model::open_mistral_nemo(),
Model::codestral_latest(),
];
let client = Client::new(None, None, None, None).unwrap();
let messages = vec![ChatMessage::new_user_message("A number between 0 and 100?")];
let options = ChatParams {
temperature: 0.0,
temperature: Some(0.0),
random_seed: Some(42),
..Default::default()
};