Skip to main content

OpenInference instrumentation for MonkAI Agent

Project description

OpenInference Instrumentation for MonkAI Agent

This package provides OpenInference instrumentation for the MonkAI Agent framework. It tracks the interactions between your application and various LLM providers (OpenAI, Azure OpenAI, etc.) through the MonkAI Agent framework.

Installation

pip install openinference-instrumentation-monkai-agent

Usage

The instrumentation will automatically track calls to all MonkAI Agent LLM providers (OpenAI, Azure OpenAI, etc.) and collect telemetry data including:

  • Model usage details (model name, temperature, tokens, etc.)
  • Request/response content
  • Provider-specific attributes
  • Performance metrics
  • Tool usage

Basic Usage

from openinference.instrumentation.monkai_agent import MonkaiAgentInstrumentor

# Enable instrumentation
MonkaiAgentInstrumentor().instrument()

# Your MonkAI Agent code here...

Configuration

You can configure the instrumentation with custom tracers:

from opentelemetry import trace
from openinference.instrumentation import TraceConfig
from openinference.instrumentation.monkai_agent import MonkaiAgentInstrumentor

# Configure custom tracer
tracer_provider = trace.TracerProvider()
trace.set_tracer_provider(tracer_provider)

# Configure and enable instrumentation
MonkaiAgentInstrumentor().instrument(
    tracer_provider=tracer_provider,
    config=TraceConfig(
        # Add your config options here
    )
)

Collected Telemetry

The instrumentation collects the following telemetry:

Common Attributes

  • Model name
  • Temperature
  • Max tokens
  • Top P
  • Frequency penalty
  • Presence penalty
  • Request messages
  • Response messages
  • Token usage statistics

Provider-Specific Attributes

  • OpenAI: Provider name
  • Azure: Provider name, endpoint, API version

Spans

  • One span per LLM completion request
  • Nested spans for provider operations

License

MIT License - See LICENSE file for details

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

Built Distribution

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

File details

Details for the file openinference_instrumentation_monkai_agent-0.0.1.tar.gz.

File metadata

File hashes

Hashes for openinference_instrumentation_monkai_agent-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d11066f07124584d8c1bda05698a928eb2c83e44afe6e2a0b272003b04c4e8be
MD5 918e44facc7e43a8ed4798d1dd1bdb2d
BLAKE2b-256 bcda3924ca34d65d930b1b66dade6cb7dad0bbe7a042e81490dabffaa1e2cdd0

See more details on using hashes here.

File details

Details for the file openinference_instrumentation_monkai_agent-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openinference_instrumentation_monkai_agent-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e81757935178fec23e6d07e794db71c2dd5d0cb034271ea393b69bfe1b36ead
MD5 50cd60cc70799d8c6a61112e29e9fe38
BLAKE2b-256 1982f51e940f5d5d9dd2634018ff71c015dce6e9c4048f152fadaf37f94174a1

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