Created: 2025-04-05 Last modified: 2025-04-05
This project demonstrates the usage of the OpenAI Agents SDK based on the official quickstart guide.
main.py: Main implementation of the OpenAI Agents SDK examples.venv/: Python virtual environmentrequirements.txt: Project dependencies.env: Environment variables file containing the OpenAI API keysetup.bat: Setup script for Windowssetup.sh: Setup script for macOS/Linux
On Windows:
.venv\Scripts\activate
On macOS/Linux:
source .venv/bin/activate
pip install -r requirements.txt
The project includes a .env file where you can store your OpenAI API key. The application will automatically load this key when it runs.
# .env file
OPENAI_API_KEY=sk-...
Alternatively, you can set the API key manually:
On Windows (PowerShell):
$env:OPENAI_API_KEY = "sk-..."
On Windows (Command Prompt):
set OPENAI_API_KEY=sk-...
On macOS/Linux:
export OPENAI_API_KEY=sk-...
If you don't have an API key, follow these instructions to create one.
python main.py
- Creating agents with specific instructions
- Defining handoffs between agents
- Adding guardrails for input validation
- Running agent orchestration
- Viewing traces in the OpenAI Dashboard
Learn more about: