This page is the complete reference for everything the workshop environment needs: Python dependencies, environment variables, the Temporal dev server, and the Jupyter kernel. In GitHub Codespaces, nearly all of this is handled automatically by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/temporalio/edu-ai-workshop-openai-agents-sdk/llms.txt
Use this file to discover all available pages before exploring further.
scripts/bootstrap.sh script — this page documents exactly what that script sets up so you can reproduce or troubleshoot any part of it.
Python Dependencies
The project is defined inpyproject.toml and requires Python ≥ 3.11. Install everything with a single command:
Runtime Dependencies
| Package | Version | Purpose |
|---|---|---|
openai | >=1.54.0 | OpenAI Python client library |
openai-agents | >=0.3.3 | OpenAI Agents SDK (tool calling, handoffs) |
temporalio | >=1.7.0 | Temporal Python SDK (workflows, activities, workers) |
httpx | >=0.27.0 | Async HTTP client used by agent tools |
rich | >=13.7.0 | Formatted terminal output in exercises |
typer | >=0.12.0 | CLI helpers for exercise scripts |
python-dotenv | >=1.0.0 | Loads .env file into environment variables |
jupyter | >=1.0.0 | Jupyter ecosystem meta-package |
ipykernel | >=6.29.0 | Jupyter kernel for Python 3.11 |
notebook | >=7.0.0 | Jupyter Notebook server |
nest-asyncio | >=1.6.0 | Allows nested event loops inside Jupyter notebooks |
pytz | >=2024.1 | Timezone support used in exercise utilities |
Dev Dependencies
| Package | Version | Purpose |
|---|---|---|
pytest | >=8.0.0 | Test runner |
pytest-asyncio | >=0.23.0 | async def test support |
ruff | >=0.6.0 | Fast Python linter and formatter |
mypy | >=1.11.0 | Static type checker |
The .env File and API Key
The bootstrap script copies .env.sample to .env automatically when the Codespace is created. The .env.sample template contains:
.env.sample
Getting an OpenAI API Key
- Sign in to the OpenAI Platform
- Click + Create new secret key
- Copy the key immediately — it is only shown once
- Paste it into your
.envfile:
.env
Verifying the Key is Set Correctly
.env with python-dotenv, checks that OPENAI_API_KEY is non-empty, and prints a masked preview:
Temporal CLI Installation
The Temporal CLI is installed byscripts/bootstrap.sh using the official installer script. In a Codespace this runs automatically at container creation time:
~/.temporalio/bin/temporal and the path is added to ~/.bashrc for all future shell sessions.
Verify the CLI is available:
Manual CLI installation (if bootstrap did not run)
Manual CLI installation (if bootstrap did not run)
If you are setting up outside Codespaces or the bootstrap script was skipped, run it directly:Or install just the CLI:
Starting the Temporal Dev Server
The Temporal dev server provides a local gRPC endpoint and a Web UI for observing workflow executions during the workshop.| Endpoint | Address |
|---|---|
| gRPC (SDK connects here) | localhost:7233 |
| Web UI | localhost:8233 |
Recommended: Use the Notebook
All workshop instructions usetemporal_installation.ipynb for starting Temporal:
- Open
temporal_installation.ipynbin VS Code - Select the
temporal-workshopkernel - Run each cell — the notebook installs the CLI (if needed) and starts the dev server
- The server persists state to
~/.temporal/default.db
Alternative: Make Target
scripts/run_temporal.sh, which is idempotent — running it when Temporal is already active prints Temporal server is already running and exits cleanly without starting a duplicate process:
Stopping the Dev Server
Accessing the Temporal Web UI in Codespaces
GitHub Codespaces automatically port-forwards both Temporal ports. Thedevcontainer.json configures this:
- Click the Ports tab at the bottom of VS Code
- Find the row labelled
Temporal UI(port8233) - Click the Globe icon in that row to open the UI in your browser
- If you need to share access, right-click the row and set visibility to Public
Can't access port 8233? Troubleshooting steps
Can't access port 8233? Troubleshooting steps
Check the server is running:If no PID is returned, restart via
temporal_installation.ipynb or make temporal-up.Check the port is forwarded:In the Ports tab, ensure port 8233 appears with a green indicator. If it is missing, click Forward a Port, enter 8233, and press Enter.Temporal UI not loading in browser:Wait 5–10 seconds after starting the server — the Web UI takes a moment to become available after the gRPC endpoint is ready.Jupyter Kernel Setup
All notebooks insolutions/ and exercises/ use the temporal-workshop kernel. The bootstrap script installs it automatically. To install or reinstall it manually:
.ipynb file in VS Code, select temporal-workshop from the kernel picker in the top-right corner of the notebook interface.
Kernel not appearing in VS Code? Troubleshooting steps
Kernel not appearing in VS Code? Troubleshooting steps
temporal-workshop kernel should appear in the kernel picker.nest-asyncio: why it is required in notebooks
nest-asyncio: why it is required in notebooks
Jupyter notebooks run an event loop internally. The Temporal SDK also needs to run an event loop for workflow and activity execution.
nest-asyncio patches the running loop to allow these nested calls without raising RuntimeError: This event loop is already running. All workshop notebooks call nest_asyncio.apply() near the top — this is expected and intentional.VS Code Extensions
Thedevcontainer.json pre-installs the following extensions in Codespaces:
| Extension ID | Name | Purpose |
|---|---|---|
ms-python.python | Python | Language support, IntelliSense, debugging |
ms-python.vscode-pylance | Pylance | Fast type-aware autocomplete |
ms-toolsai.jupyter | Jupyter | Notebook editing and kernel management |
charliermarsh.ruff | Ruff | Inline linting and format-on-save |