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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openinference_instrumentation_monkai_agent-0.0.1.tar.gz.
File metadata
- Download URL: openinference_instrumentation_monkai_agent-0.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d11066f07124584d8c1bda05698a928eb2c83e44afe6e2a0b272003b04c4e8be
|
|
| MD5 |
918e44facc7e43a8ed4798d1dd1bdb2d
|
|
| BLAKE2b-256 |
bcda3924ca34d65d930b1b66dade6cb7dad0bbe7a042e81490dabffaa1e2cdd0
|
File details
Details for the file openinference_instrumentation_monkai_agent-0.0.1-py3-none-any.whl.
File metadata
- Download URL: openinference_instrumentation_monkai_agent-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e81757935178fec23e6d07e794db71c2dd5d0cb034271ea393b69bfe1b36ead
|
|
| MD5 |
50cd60cc70799d8c6a61112e29e9fe38
|
|
| BLAKE2b-256 |
1982f51e940f5d5d9dd2634018ff71c015dce6e9c4048f152fadaf37f94174a1
|