This repository contains the Python code examples from the LinkedIn Learning course Build with AI: Create Agents with the OpenAI Agents SDK. The full course can be found on LinkedIn Learning.
You’ll learn how to:
- Build and configure an AI travel agent using the OpenAI Agents SDK in Python.
- Integrate tools that allow your agent to connect to external data sources and perform real-world tasks.
- Design a multi-agent workflow using handoffs so agents can collaborate and delegate specialized tasks.
- Implement guardrails, sessions, and tracing to ensure your agent is safe, reliable, and easy to monitor.
- Identify ways to extend your AI travel agent with additional features, data sources, and user experiences.
- Python 3.9+
- An OpenAI API key
- Clone this repo (or download the files).
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
- Set your OpenAI API key or place in .env file:
export OPENAI_API_KEY="your_api_key" # macOS/Linux setx OPENAI_API_KEY "your_api_key" # Windows PowerShell
Run the main demo script to see all lessons in action:
python agent.py