Skip to main content

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.

Metadata

Release files for respan-instrumentation-mistralai 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-mistralai 0.1.1
File Size Uploaded Provenance Actions
respan_instrumentation_mistralai-0.1.1.tar.gz 8.6 kB Without provenance Details for respan_instrumentation_mistralai-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-mistralai 0.1.1
File Interpreter ABI Platform Actions
respan_instrumentation_mistralai-0.1.1-py3-none-any.whl Python 3 none any Details for respan_instrumentation_mistralai-0.1.1-py3-none-any.whl

Total release size: 17.7 kB

Release files / respan_instrumentation_mistralai-0.1.1.tar.gz

Download URL respan_instrumentation_mistralai-0.1.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4b8099d1c0426cd57a317314f369eff38d57730058dea6147e3874e76a8373ac
BLAKE2b-256 checksum
How to use checksums
a6d7ecec381957894548b12ff924961916d97f33d2200bde87e1d4f20334e61e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / respan_instrumentation_mistralai-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_mistralai-0.1.1-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5cd71452d57b0f5d4d113d0bab85093e3aa599c252edbfff7e5cb34fc367500
BLAKE2b-256 checksum
How to use checksums
c2a934ba8f7712e76fdd7a3c6f50fdb46e63902ac7b79d93b02fd8ee68592018
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for respan-instrumentation-mistralai 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page