Rust client for the Mistral AI API.
Important
While we are in v0, minor versions may introduce breaking changes.
Please, refer to the CHANGELOG.md for more information.
- Chat without streaming
- Chat without streaming (async)
- Chat with streaming
- Embedding
- Embedding (async)
- List models
- List models (async)
- Function Calling
- Function Calling (async)
You can install the library in your project using:
cargo add mistralai-client
You can get your Mistral API Key there: https://docs.mistral.ai/#api-access.
Just set the MISTRAL_API_KEY
environment variable.
use mistralai_client::v1::client::Client;
fn main() {
let client = Client::new(None, None, None, None);
}
MISTRAL_API_KEY=your_api_key cargo run
use mistralai_client::v1::client::Client;
fn main() {
let api_key = "your_api_key";
let client = Client::new(Some(api_key), None, None, None).unwrap();
}
examples/chat.rs
examples/chat_async.rs
examples/chat_with_streaming.rs
examples/chat_with_function_calling.rs
examples/chat_with_function_calling_async.rs
examples/embeddings.rs
examples/embeddings_async.rs
examples/list_models.rs
examples/list_models_async.rs
Please read CONTRIBUTING.md for details on how to contribute to this library.