Welcome to the O'Reilly Live Training on OpenAI AgentKit! This course will guide you through building AI agents using OpenAI's latest APIs, including structured outputs, file search, and multi-modal capabilities.
Using uv (Recommended)
This project uses uv, a fast Python package installer and resolver. The Makefile handles most setup automatically.
-
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh -
One-command setup:
make all
This creates a virtual environment in
.venv, installs dependencies, and sets up Jupyter kernel. -
Activate the environment:
source .venv/bin/activate -
Setup your OpenAI API key:
- Get your API key from OpenAI Platform
- Create a
.envfile in the project root:
echo "OPENAI_API_KEY=your-api-key-here" > .env
Using Pip (Traditional Method)
-
Create a Virtual Environment: Navigate to your project directory. Make sure you have Python 3.11+ installed!
python -m venv .venv
-
Activate the Virtual Environment:
- On macOS and Linux:
source .venv/bin/activate - On Windows:
.\.venv\Scripts\activate
- On macOS and Linux:
-
Install Dependencies:
pip install --upgrade pip pip install -r ./requirements/requirements.txt
-
Setup Jupyter Kernel:
python -m ipykernel install --user --name=openai-agentkit
-
Setup your OpenAI API key: Create a
.envfile in the project root:echo "OPENAI_API_KEY=your-api-key-here" > .env
Remember to deactivate the virtual environment when done: deactivate
Using Conda
- Install anaconda or miniconda
- This repo was tested with Python 3.11
- Create an environment:
conda create -n openai-agentkit python=3.11 - Activate your environment:
conda activate openai-agentkit - Install requirements:
pip install -r requirements/requirements.txt - Setup Jupyter kernel:
python -m ipykernel install --user --name=openai-agentkit - Setup your OpenAI API key
The project includes a Makefile for common tasks:
# Create virtual environment and install everything
make all
# Clean up environment
make clean
# Add new packages
make add pandas numpy
# Update requirements after manual changes
make env-update
# Show activation command
make activateCreate a .env file in the project root:
OPENAI_API_KEY=your-openai-api-key-hereThe main notebooks are organized in a progressive learning path:
-
Intro to Agents with Responses API - Fundamentals of building agents with OpenAI
-
Simple Chat with Responses API - Building conversational interfaces
-
Structured Outputs for Data Extraction - Extracting structured data with guaranteed schemas
-
Agentic Workflows with Structured Outputs - Building complex agent workflows
-
File Search & RAG with Agentic Retrieval - Implementing retrieval-augmented generation
-
Video Script Generation with Images - Multi-modal agents with vision capabilities
-
Chat with Paper Agent - Building document Q&A agents
-
Research Report Generation - End-to-end research agent system
-
OpenAI API Overview - Comprehensive overview of OpenAI's APIs
-
Reference Implementations: Check
notebooks/reference-implementations-for-production/for production-ready examples
├── notebooks/ # Main learning notebooks
│ ├── 1.0-intro-agents-responses-api.ipynb
│ ├── 2.0-simple-chat-responses-api.ipynb
│ ├── 3.0-structured-outputs-data-extraction.ipynb
│ ├── 4.0-agentic-workflow-with-struct-out-responses.ipynb
│ ├── 5.0-file-search-rag-agentic-retrieval.ipynb
│ ├── 6.0-video-script-generation-with-images.ipynb
│ ├── 7.0-chat-with-paper-agent.ipynb
│ ├── 8.0-research-report-generation.ipynb
│ ├── openai-api-overview.ipynb
│ └── reference-implementations-for-production/
├── presentation/ # Course presentation materials
├── assets/ # Images, diagrams, and resources
├── demos/ # Demo applications
├── requirements/ # Python dependencies
│ ├── requirements.in # Direct dependencies
│ └── requirements.txt # Locked dependencies
├── Makefile # Automation scripts
└── .venv/ # Virtual environment (created by setup)
This course covers:
- OpenAI Responses API: Building agentic workflows with the latest OpenAI APIs
- Structured Outputs: Guaranteed JSON schemas for reliable data extraction
- File Search & RAG: Implementing retrieval-augmented generation patterns
- Multi-modal Agents: Working with text, images, and documents
- Production Patterns: Best practices for deploying AI agents
Jupyter Kernel Not Found:
python -m ipykernel install --user --name=openai-agentkitAPI Key Issues:
Make sure your .env file is in the project root and contains:
OPENAI_API_KEY=sk-...
Package Installation Issues: Try upgrading pip first:
pip install --upgrade pip
pip install -r requirements/requirements.txtMaterials created for O'Reilly Live Training