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 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


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.7.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.7-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceai_mistralai-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 a84c3c70475b47e7f33905d27fac302a5d55a883fb73a545a9797a057e83564f
MD5 26d615abada70ce5bd03a10f5ebd08e6
BLAKE2b-256 d10938a5eee4bb30b361f10cc27027447ed0dcbf1ef4c667605891269fe49e25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traceai_mistralai-0.1.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 81b82267f2443e07618c0fccf728eeed939c2230dab7dfb90dfb7c9eeef2f5b7
MD5 1aaa1888dc6ca36c212c619fb17166e4
BLAKE2b-256 aff3ad64aae9b96f78903aa1b6ae0c1ffedfd7d35b3bc8466f05782b59962da0

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