OpenAI Agents SDK
Trace OpenAI Agents SDK runs by wiring AxonPushRunHooks into your agent configuration. Captures agent lifecycle, tool calls, and handoffs between agents.
Installation
Section titled “Installation”npm install @axonpush/sdk openaiimport { AxonPush } from "@axonpush/sdk";import { AxonPushRunHooks } from "@axonpush/sdk/integrations/openai-agents";
const client = new AxonPush({ apiKey: process.env.AXONPUSH_API_KEY!, tenantId: process.env.AXONPUSH_TENANT_ID!,});
const hooks = new AxonPushRunHooks({ client, channelId: 1, agentId: "my-agent",});import { Agent, Runner } from "openai/agents";
const agent = new Agent({ name: "assistant", instructions: "You are a helpful assistant.", tools: [webSearch, calculator],});
const result = await Runner.run(agent, input, { hooks });Events Traced
Section titled “Events Traced”| Event | When |
|---|---|
agent.run.start | An agent run begins |
agent.run.end | An agent run completes |
tool.*.start | A tool invocation begins |
tool.*.end | A tool invocation completes |
agent.handoff | Control is handed off to another agent |