- Python
- TypeScript
The OpenAI Agents Python SDK is a lightweight and powerful framework for building multi-agent workflows.
Installation
Install the required dependencies usingpip:Get started
To use the OpenAI Agents SDK with Weave:- Initialize Weave with your project name.
- Add the Weave tracing processor to your agents.
- Create and run your agents as usual.
WeaveTracingProcessor is set up to capture execution traces. A Weather data model represents weather information. The get_weather function is decorated as a tool the agent can use and returns a sample weather report. An agent named Hello world is configured with basic instructions and access to the weather tool. The main function runs the agent asynchronously with a sample input (What's the weather in Tokyo?) and prints the final response.View traces
When the above code sample is run, a link to the Weave dashboard is generated. Open the link to inspect traces from your agent run.Realtime API with the Python Agents SDK
For tracing realtime voice agents built withRealtimeAgent and RealtimeRunner from the OpenAI Agents Python SDK, follow OpenAI Realtime API. That guide uses patch_openai_realtime() with Weave.