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

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceai_mistralai-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 4591985466abcaf742901bee3faa0dc9df3d3e213bdaff780cea29ca31582eae
MD5 ead9d79ed534f2aa3ccb95ae572008cf
BLAKE2b-256 d5ce9fe4ba883b00281de5387ae8e32536285d73da45545f4d26bb04c66e21c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traceai_mistralai-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b27d52373acdebe34418d9ddcf8ce5c8a67ab8838a7c58026b91016222e5c8c0
MD5 fb00638c1a8ebf14e2a89cbba957ea51
BLAKE2b-256 33dd2360ec46eb628f15b3d972f4656017702158b4fb7b856eda4d6c42c14f43

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