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

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceai_mistralai-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 c28539b3301586356c1833631aea063fd7c83089f93559a9218a4b1831f650cd
MD5 d7ed982af3e39999f48d71564722f3bc
BLAKE2b-256 19fb69590fee838fcf554d820432c0105e6e52e249763ea580c0e935da51e259

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traceai_mistralai-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 14d3d970f92d5e51f499b3084d819d5c426175ee63545d374ed3231e7d0c0b32
MD5 a395976bfecb64cebc19ef2fec694048
BLAKE2b-256 f63ba77ea859eeb6fd24a65bbf6f14b87ecee1553dfc9a28e51423dd07fe772e

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