For a complete example, see the OpenAI Agents
example
on GitHub.
Prerequisites
- Python 3.8+
- OpenAI API key
- Gentrace API key
- OpenAI Agents SDK
Installation
Configuration
Initialize Gentrace with OpenAI Agents instrumentation:openai_agents_instrumentation.py
Environment Variables
.env
What Gets Traced
The OpenAI Agents instrumentation automatically captures:- Agent conversations - All messages between users and agents
- Tool calls - Function invocations with parameters and results
- Agent handoffs - Transfers between specialized agents
- Context variables - Shared state between agents
- Full message history - Complete conversation flow