Skip to main content

Overview

Quraite provides a built-in adapter for OpenAI Agents. This adapter allows you to integrate OpenAI Agents with Quraite and run evaluations on them. This adapter uses OpenInference instrumentation to capture the trajectory of the agent.

Prerequisites

  • Agent dependencies: openai-agents package, OpenAI API key, and any tools you want to use.
  • Quraite dependencies: quraite[openai-agents-oi] package.

Define Your OpenAI Agent

You create a normal OpenAI Agent first, exactly as you would in any OpenAI Agents project.

Set up Tracing

Quraite provides a tracing setup helper. For OpenAI Agents, pass the Framework.OPENAI_AGENTS enum:

Wrap the OpenAI Agent

Inject the tracer_provider into the OpenaiAgentsAdapter so Quraite can capture spans and metrics from the agent.

Run the Agent

Once wrapped, you expose the adapter using Quraite’s run_agent helper.

End-to-End Examples