import { agentops } from 'agentops';// Initialize with environment variable AGENTOPS_API_KEYawait agentops.init();// Or pass API key explicitlyawait agentops.init({ apiKey: 'your-api-key'});// Your AI agent code here - instrumentation happens automatically!
import { agentops } from 'agentops';import { Agent, run } from '@openai/agents';// Initialize AgentOps firstawait agentops.init();// Create your agent with tools and instructionsconst agent = new Agent({ name: 'My Assistant', instructions: 'You are a helpful assistant.', tools: [/* your tools */],});// Run the agent - instrumentation happens automaticallyconst result = await run(agent, "Hello, how can you help me?");console.log(result.finalOutput);
Automatically captures:
Agent Lifecycle: Track agent creation, execution, and completion
LLM Generation: Capture model requests, responses, and token usage
Function Calls: Monitor tool usage and function execution
Audio Processing: Observe speech-to-text and text-to-speech operations
Handoffs: Track agent-to-agent communication and workflow transitions