Skip to main content
This is a different package from plain openai: the Agents SDK (import agents) adds its own Agent/Runner abstraction, tool calling, and handoffs on top of the Chat Completions/Responses APIs. Use this page if your code imports from agents; use the OpenAI page if you’re calling openai.chat.completions.create() directly. Install:

Usage

EvaluationSubject.framework only accepts a fixed set of values ("raw_python", "openai", "anthropic", "google", "langchain", "llamaindex", "crewai", "autogen", "n8n", "flowise", "other"). "openai-agents" isn’t one of them, so subject.framework must be "other" here. This is unrelated to tracer.trace(framework=...) below, which accepts any string and does use "openai-agents"; the two framework fields are independent and differently constrained.

With tracing

Unlike Anthropic/LangChain/CrewAI, there’s no way to get trace_id back from the Agents SDK’s own tracing integration (AgentXTracingProcessor). It’s a processor you register once at startup and it reports on its own schedule as runs complete elsewhere in the SDK, not a span your eval function controls. To link a trace to an eval result, wrap Runner.run_sync(...) in tracer.trace(..., sync=True) directly instead, the same pattern as the raw OpenAI example:
If you also want every other (non-eval) run of this agent traced automatically, not just the ones going through an evaluation, register AgentXTracingProcessor globally in addition to the pattern above. The two don’t conflict, but they are independent: the processor’s traces are separate from, and won’t be linked to, any eval result’s trace_id.

EvaluationCase fields

Same contract as every other framework: see Examples overview for the full EvaluationCase/return-value reference. case.query is what you pass to Runner.run_sync(agent, case.query).