Skip to content

About

A demonstration of the OpenAI Agents SDK with examples of creating agents, defining handoffs, adding guardrails, and running agent orchestration

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Agents SDK Quickstart

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.

Project Structure

  • main.py: Main implementation of the OpenAI Agents SDK examples
  • .venv/: Python virtual environment
  • requirements.txt: Project dependencies
  • .env: Environment variables file containing the OpenAI API key
  • setup.bat: Setup script for Windows
  • setup.sh: Setup script for macOS/Linux

Setup Instructions

1. Activate the virtual environment

On Windows:

.venv\Scripts\activate

On macOS/Linux:

source .venv/bin/activate

2. Install dependencies

pip install -r requirements.txt

3. Set your OpenAI API key

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.

4. Run the example

python main.py

Features Demonstrated

  • Creating agents with specific instructions
  • Defining handoffs between agents
  • Adding guardrails for input validation
  • Running agent orchestration
  • Viewing traces in the OpenAI Dashboard

Next Steps

Learn more about:

About

A demonstration of the OpenAI Agents SDK with examples of creating agents, defining handoffs, adding guardrails, and running agent orchestration

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages