openinference-instrumentation-mistralai package.
Install
Setup
Set theMISTRAL_API_KEY environment variable to authenticate calls made using the SDK.
register function:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Instrument LLM calls made using MistralAI’s SDK via the MistralAIInstrumentor
openinference-instrumentation-mistralai package.
pip install openinference-instrumentation-mistralai mistralai
MISTRAL_API_KEY environment variable to authenticate calls made using the SDK.
export MISTRAL_API_KEY=[your_key_here]
register function:
import os
from mistralai import Mistral
from mistralai.models import UserMessage
api_key = os.environ["MISTRAL_API_KEY"]
model = "mistral-tiny"
client = Mistral(api_key=api_key)
chat_response = client.chat.complete(
model=model,
messages=[UserMessage(content="What is the best French cheese?")],
)
print(chat_response.choices[0].message.content)
Was this page helpful?
