Setup
- Python
Usage
Once initialized, all Mistral calls are captured automatically:What Gets Captured
Run the example
Clone the repo and run a complete agent end-to-end.Python
Run the Python example
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Auto-instrument Mistral AI API calls
import traceroot
from traceroot import Integration
traceroot.initialize(integrations=[Integration.MISTRAL])
import os
from mistralai import Mistral
import traceroot
from traceroot import Integration
traceroot.initialize(integrations=[Integration.MISTRAL])
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
# This call is automatically traced
response = client.chat.complete(
model="mistral-large-latest",
messages=[
{"role": "user", "content": "What is the capital of France?"},
],
)
print(response.choices[0].message.content)
| Attribute | Description |
|---|---|
| Model | mistral-large-latest, mistral-small-latest, etc. |
| Messages | Input messages array |
| Response | Completion content |
| Tool calls | Function calls emitted by the model |
| Tokens | Input and output tokens |
| Cost | Calculated from token usage and model pricing |
| Latency | Request duration |