Fork of MistralAI client library with httpx allowed to be 0.27.0+. Will track with official Mistral release until this is addressed in the main package.
Project description
Mistral Python Client
Mitta Build
NOTE: This fork will track with Mistral's client library until that library is updated with a newer dependency for httpx. This library allows httpx version >= 0.27.0. No other changes, other than import names, have been made to this library. This library has been tested for embeddings and chat completions.
The source code is located here. This is NOT a client library for Mitta.
Carry On
This client is inspired from cohere-python
You can use the Mistral Python client to interact with the Mistral AI API.
Installing
pip install mitta_mistralai
From Source
This client uses poetry
as a dependency and virtual environment manager.
You can install poetry with
pip install poetry
poetry
will set up a virtual environment and install dependencies with the following command:
poetry install
Run examples
You can run the examples in the examples/
directory using poetry run
or by entering the virtual environment using poetry shell
.
API Key Setup
Running the examples requires a Mistral AI API key.
- Get your own Mistral API Key: https://docs.mistral.ai/#api-access
- Set your Mistral API Key as an environment variable. You only need to do this once.
# set Mistral API Key (using zsh for example)
$ echo 'export MISTRAL_API_KEY=[your_key_here]' >> ~/.zshenv
# reload the environment (or just quit and open a new terminal)
$ source ~/.zshenv
Using poetry run
cd examples
poetry run python chat_no_streaming.py
Using poetry shell
poetry shell
cd examples
>> python chat_no_streaming.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mitta_mistralai-0.1.3b2.tar.gz
.
File metadata
- Download URL: mitta_mistralai-0.1.3b2.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 936a14cf535f91adfad6efcd20e18de425333712345fbba283ee0499896d7d12 |
|
MD5 | 8a0a9c7f3102a3a28800762b3c3cef0d |
|
BLAKE2b-256 | 1473191f5d7f7c70d23ab559eb0d712fcfbe27ff4da99030e92ed5b4957dc026 |
File details
Details for the file mitta_mistralai-0.1.3b2-py3-none-any.whl
.
File metadata
- Download URL: mitta_mistralai-0.1.3b2-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.13 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 670df2a48a8ebe4a13062fd67746000dc3280866f6ecd4de934854b9ca2cb60a |
|
MD5 | bf3fa79671866d226d74fab1b07cbd5f |
|
BLAKE2b-256 | e72ddf0e527f3826f3254eab898e7495480dd165761899ff816af56147ff8385 |