Set the MISTRAL_API_KEY environment variable to authenticate calls made using the SDK.
export MISTRAL_API_KEY=[your_key_here]
Connect your application to Phoenix with the register function:
Run Mistral
import osfrom mistralai.client import Mistralapi_key = os.environ["MISTRAL_API_KEY"]model = "mistral-small-latest"client = Mistral(api_key=api_key)chat_response = client.chat.complete( model=model, messages=[{"role": "user", "content": "What is the best French cheese?"}],)print(chat_response.choices[0].message.content)
Observe
Now that you have tracing setup, all invocations of Mistral (completions, chat completions, embeddings) will be streamed to your running Phoenix for observability and evaluation.