Skip to main content

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

  1. Install traceAI MistralAI
pip install traceAI-mistralai

Set Environment Variables

Set up your environment variables to authenticate with both 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",
    project_version_name="v1",
    session_name="chat-bot"
)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traceai_mistralai-0.1.3.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traceai_mistralai-0.1.3-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file traceai_mistralai-0.1.3.tar.gz.

File metadata

  • Download URL: traceai_mistralai-0.1.3.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.1.0

File hashes

Hashes for traceai_mistralai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 036a62c71b0375ec20ac56bf0290e3b00ec7f00ae35ebb1813fe767b642b25ee
MD5 c17ae3d3319ff7e7d7e691e90083433d
BLAKE2b-256 0816d0a923d73023563848765f0bc5c4b20df17708443c2caac4d0a1485a96ce

See more details on using hashes here.

File details

Details for the file traceai_mistralai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: traceai_mistralai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.1.0

File hashes

Hashes for traceai_mistralai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d1c850c88586651775aa02d9f6ec0c7df18850778116a45398ea6b5477e4ae7
MD5 800b47951d7f4936a4c8fabdf5b5281f
BLAKE2b-256 42b3086bc308e05df33fe49bdc930f516000258338c63bccdfbdeb374711fff5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page