Respan Mistral AI instrumentation
Trace the official mistralai Python SDK with Respan.
This package wraps openinference-instrumentation-mistralai and registers
Respan's OpenInference translator so Mistral AI spans are emitted with the
canonical traceloop.*, gen_ai.*, llm.*, and respan.* fields expected by
the Respan OTLP pipeline. It covers synchronous and asynchronous chat,
streaming content and usage, request tool definitions, current-turn tool calls,
precise provider error status, and interrupted-stream finalization. Duplicate
native Mistral SDK spans are suppressed only for the SDK's own instrumentation
scope. Tested dependency support starts at mistralai==2.9.3 and
openinference-instrumentation-mistralai==2.0.6.
Install
pip install respan-ai respan-instrumentation-mistralai mistralai
Usage
import os
from mistralai.client import Mistral
from respan import Respan
from respan_instrumentation_mistralai import MistralAIInstrumentor
respan = Respan(
api_key=os.environ["RESPAN_API_KEY"],
instrumentations=[MistralAIInstrumentor()],
)
with Mistral(api_key=os.environ["MISTRAL_API_KEY"]) as client:
response = client.chat.complete(
model="mistral-large-latest",
messages=[
{
"role": "user",
"content": "Reply with one concise sentence about tracing.",
}
],
)
print(response.choices[0].message.content)
respan.flush()
respan.shutdown()
Any keyword arguments passed to MistralAIInstrumentor(...) are forwarded to the
underlying OpenInference instrumentor. Multiple Respan Mistral instrumentor
instances share one OpenInference delegate and one normalization processor;
the final owner deactivates them. Shared instances must use identical keyword
arguments. An activation with different arguments is rejected and remains
inactive rather than silently inheriting another instance's configuration.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_mistralai-0.1.1.tar.gz.
File metadata
- Download URL: respan_instrumentation_mistralai-0.1.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b8099d1c0426cd57a317314f369eff38d57730058dea6147e3874e76a8373ac
|
|
| MD5 |
604021955f14420a3627b4fc3fdbe752
|
|
| BLAKE2b-256 |
a6d7ecec381957894548b12ff924961916d97f33d2200bde87e1d4f20334e61e
|
File details
Details for the file respan_instrumentation_mistralai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_mistralai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5cd71452d57b0f5d4d113d0bab85093e3aa599c252edbfff7e5cb34fc367500
|
|
| MD5 |
fe1e24d0b1b6433fc66e2b7001bdb27e
|
|
| BLAKE2b-256 |
c2a934ba8f7712e76fdd7a3c6f50fdb46e63902ac7b79d93b02fd8ee68592018
|