AgentOps and OpenAI Agents SDK integration for powerful multi-agent workflow monitoring.
Give us a star to bookmark on GitHub, save for later 🖇️)
OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows. The SDK provides a comprehensive set of tools for creating, managing, and monitoring agent-based applications.
from agents import Agent, Runnerimport agentops# Initialize AgentOpsagentops.init()agent = Agent(name="Assistant", instructions="You are a helpful assistant")result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")print(result.final_output)# Output:# Code within the code,# Functions calling themselves,# Infinite loop's dance.
import asynciofrom agents import Agent, Runner, function_toolimport agentops# Initialize AgentOpsagentops.init()@function_tooldef get_weather(city: str) -> str: return f"The weather in {city} is sunny."agent = Agent( name="Hello world", instructions="You are a helpful agent.", tools=[get_weather],)async def main(): result = await Runner.run(agent, input="What's the weather in Tokyo?") print(result.final_output) # The weather in Tokyo is sunny.if __name__ == "__main__": asyncio.run(main())