OpenTelemetry instrumentation for OpenAI Agents
Project description
OpenAI Agents OpenTelemetry Integration
Overview
This integration provides support for using OpenTelemetry with the OpenAI Agents framework. It enables tracing and monitoring of applications built with OpenAI Agents.
Installation
- Install traceAI OpenAI Agents
pip install traceAI-openai-agents
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
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="openai_agents_app"
)
Configure OpenAI Agents Instrumentation
Instrument the OpenAI Agents client to enable telemetry collection. This step ensures that all interactions with the OpenAI Agents SDK are tracked and monitored.
from traceai_openai_agents import OpenAIAgentsInstrumentor
OpenAIAgentsInstrumentor().instrument(tracer_provider=trace_provider)
Create OpenAI Agents Components
Set up your OpenAI Agents client with built-in observability.
from agents import Agent, Runner
agent = Agent(name="Assistant", instructions="You are a helpful assistant")
result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")
print(result.final_output)
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
File details
Details for the file traceai_openai_agents-0.1.3.tar.gz
.
File metadata
- Download URL: traceai_openai_agents-0.1.3.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
915a7472ff9d95468d3388221b098bd2aaa0116486a63cd1199c01742a0663a0
|
|
MD5 |
1f6a9423056e0f99f53c0f93a835cb64
|
|
BLAKE2b-256 |
383be635c9717c4b784043323775f42191e7ffb35f9c036c793d496eeacf54ac
|
File details
Details for the file traceai_openai_agents-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: traceai_openai_agents-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6fe35c767a12cb06f96ea9479f9ff7ffd4918c87dddc7ca479bf0d0d4e6535e5
|
|
MD5 |
52ac77ec6aac821080083b2ba71da57b
|
|
BLAKE2b-256 |
6bf271d000e1acc42c3705d62b2cbfc383a3fd1ad748dc61635325f6d20c8ae6
|