Installation
Requires Python SDK version
langsmith>=0.3.15.Quick Start
You can integrate LangSmith tracing with the OpenAI Agents SDK by using theOpenAIAgentsTracingProcessor class.

We've raised a $125M Series B to build the platform for agent engineering. Read more.
langsmith>=0.3.15.pip install "langsmith[openai-agents]"
OpenAIAgentsTracingProcessor class.
import asyncio
from agents import Agent, Runner, set_trace_processors
from langsmith.integrations.openai_agents_sdk import OpenAIAgentsTracingProcessor
async def main():
agent = Agent(
name="Captain Obvious",
instructions="You are Captain Obvious, the world's most literal technical support agent.",
)
question = "Why is my code failing when I try to divide by zero? I keep getting this error message."
result = await Runner.run(agent, question)
print(result.final_output)
if __name__ == "__main__":
set_trace_processors([OpenAIAgentsTracingProcessor()])
asyncio.run(main())

Was this page helpful?