OpenTelemetry instrumentation for Mistral AI
Project description
MistralAI OpenTelemetry Integration
Overview
This integration provides support for using OpenTelemetry with the MistralAI framework. It enables tracing and monitoring of applications built with MistralAI.
Installation
- Install traceAI MistralAI
pip install traceAI-mistralai
Set Environment Variables
Set up your environment variables to authenticate with FutureAGI
import os
os.environ["FI_API_KEY"] = FI_API_KEY
os.environ["FI_SECRET_KEY"] = FI_SECRET_KEY
os.environ["MISTRAL_API_KEY"] = MISTRAL_API_KEY
Quickstart
Register Tracer Provider
Set up the trace provider to establish the observability pipeline. The trace provider:
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
trace_provider = register(
project_type=ProjectType.OBSERVE,
project_name="mistralai_app"
)
Configure MistralAI Instrumentation
Instrument the MistralAI client to enable telemetry collection. This step ensures that all interactions with the MistralAI SDK are tracked and monitored.
from traceai_mistralai import MistralAIInstrumentor
MistralAIInstrumentor().instrument(tracer_provider=trace_provider)
Create MistralAI Components
Set up your MistralAI client with built-in observability.
from mistralai import Mistral
client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
if __name__ == "__main__":
response = client.agents.complete(
agent_id="agent_id",
messages=[
{"role": "user", "content": "plan a vacation for me in Tbilisi"},
],
)
print(response)
Project details
Release history Release notifications | RSS feed
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 traceai_mistralai-0.1.8.tar.gz.
File metadata
- Download URL: traceai_mistralai-0.1.8.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
679d977233c8feb69d083d598f25fab3ef4538407e9683869e5a6e4c18c0e454
|
|
| MD5 |
d6dcacc3392efa75a20db369492c6000
|
|
| BLAKE2b-256 |
306a0a51f293b45de0f5509060cbbef264cee23c245ce95824405d13b06f15c4
|
File details
Details for the file traceai_mistralai-0.1.8-py3-none-any.whl.
File metadata
- Download URL: traceai_mistralai-0.1.8-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b0a859a0a57222c0257cab5fd99b8d14fdec2828b3804e9e6c808f939edcddf
|
|
| MD5 |
f540e814e440f95dfc9b3284e2c8f334
|
|
| BLAKE2b-256 |
8ad2eb99d2e35bf2fe3bac099b08ba0d4a08bb26100dc0fb7d3248b3ff835acf
|