The workshop repository ships aDocumentation 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.
Makefile that wraps the most common development tasks into short, memorable commands. This page documents every target — the exact shell command it runs, its purpose, and any important caveats to keep in mind during the 90-minute session.
Command Overview
| Target | Command run | Purpose |
|---|---|---|
make setup | pip install -e ".[dev]" | Install all Python dependencies in editable mode |
make env | python scripts/check_env.py | Validate OPENAI_API_KEY is set in .env |
make lint | ruff check . then mypy exercises/ solutions/ scripts/ | Run code quality checks |
make test | pytest -v | Run the full test suite |
make temporal-up | bash scripts/run_temporal.sh | Start the Temporal dev server (idempotent) |
make temporal-down | pkill -f "temporal server start-dev" || echo "Temporal not running" | Stop the Temporal dev server |
make clean | Remove __pycache__, .pytest_cache, .mypy_cache | Delete generated cache directories |
Detailed Reference
make setup — Install dependencies
make setup — Install dependencies
[dev] extra pulls in the testing and linting tools — pytest, pytest-asyncio, ruff, and mypy — in addition to the runtime dependencies (openai, openai-agents, temporalio, jupyter, ipykernel, python-dotenv, rich, nest-asyncio, etc.).When to run: Once after the Codespace starts (this is done automatically by bootstrap.sh), and again every time you run git pull to pick up any new or updated dependencies.make env — Validate OPENAI_API_KEY
make env — Validate OPENAI_API_KEY
scripts/check_env.py, which loads .env via python-dotenv and verifies that OPENAI_API_KEY is present and non-empty. If the check passes, it prints the first eight and last four characters of the key so you can confirm the correct key is loaded. If the check fails — because .env doesn’t exist, or the key is missing — it prints a specific error message and exits with a non-zero status code.When to run: Before starting exercises 1, 3, and 4, all of which make live OpenAI API calls.make lint — Code quality checks
make lint — Code quality checks
ruff check .— Fast Python linter checking for style errors (E), undefined names (F), import ordering (I), naming conventions (N), and warnings (W). Line length is set to 100 characters with E501 ignored. Target version is Python 3.11.mypy exercises/ solutions/ scripts/— Static type checker targeting Python 3.11.warn_return_anyandwarn_unused_configsare enabled;disallow_untyped_defsis off to keep exercise starter code approachable.
make test — Run the test suite
make test — Run the test suite
tests/ directory and are discovered via the test_*.py filename pattern (configured in pyproject.toml). The pytest-asyncio plugin handles async test functions automatically (asyncio_mode = "auto").Important: All tests mock the OpenAI API — no real OPENAI_API_KEY is required to run the test suite. This means CI runs pytest -q without any secrets configured, making it safe to run in pull request pipelines.When to run: After making changes to exercise or solution code to confirm nothing is broken.Tests use mocked OpenAI calls, so they run offline and do not consume API
credits. You can run
make test freely without worrying about cost.make temporal-up — Start Temporal server
make temporal-up — Start Temporal server
temporal server start-dev process is already running, the script exits immediately without starting a duplicate. When starting fresh, it launches the server with a persistent SQLite database at ~/.temporal/default.db, waits three seconds to confirm the process is alive, then blocks the terminal while the server runs. Press Ctrl+C to stop it.- gRPC endpoint:
localhost:7233(used by workers and starters to connect) - Web UI:
localhost:8233(open in your browser to observe workflows)
make temporal-down — Stop Temporal server
make temporal-down — Stop Temporal server
temporal server start-dev. If no matching process is found, it prints "Temporal not running" and exits cleanly without an error. The in-memory workflow state is lost when the server stops, but the SQLite database at ~/.temporal/default.db persists workflow history across restarts.When to run: When you’re done with exercises that require Temporal and want to free up resources, or when you need to restart the server after a crash.make clean — Remove cache directories
make clean — Remove cache directories
__pycache__, .pytest_cache, and .mypy_cache directories from the entire repository tree. Errors (e.g., a directory already being deleted) are suppressed. This is safe to run at any time and does not affect source files, notebooks, or .env.When to run: If you’re seeing stale import errors or mypy is reporting errors from deleted files, a clean sweep often resolves them.Running Exercise 4 (Production Pattern)
Exercises 1–3 are Jupyter notebooks you open in VS Code. Exercise 4 uses separate Python files that mirror a real production Temporal deployment. You need two terminals running simultaneously:Start the worker (Terminal 1)
The worker process connects to Temporal and polls the Leave this terminal open — the worker must remain running.
"routing-workflow-queue" task queue for work:The task queue name
"routing-workflow-queue" must match in both worker.py
and starter.py. If the worker isn’t picking up tasks, this is the first
thing to verify.