# Downloadable examples

These are complete fictional learning fixtures for the AI Labs series. They contain no customer data or SAP connection.

## Use the folder

Download/copy the **whole examples folder**, then open it in your editor. Keep its files together. Complete [the API setup guide](/labs/openai-api-summarizer/) for Python virtual-environment and shell-specific key instructions. The local-only payment and testing scripts need no API key.

From an activated Python 3.12+ environment, install `python -m pip install -r requirements.txt` for the API/PDF labs. The MCP lab separately installs `mcp>=1.12,<2` in its own environment. Record actual installed versions with `python -m pip freeze`; the ranges constrain API families but are not an exact lockfile.

## Files and first commands

| Files | Purpose | First command / action |
|---|---|---|
| `notes.txt`, `requests.json` | Fictional requests with missing information | Inspect before using a model |
| `task-tracker-starter.html` | Add-only starter | Open in a browser |
| `task-tracker-finished.html` | Complete/Undo/Delete reference | Open and run the acceptance checks |
| `task-tracker-counter-starter.html` | Finished controls, counter removed | Use for the Codex lab |
| `billing.py`, `test_billing.py` | Intentionally defective sum | `python -m unittest test_billing.py -v` must fail before repair |
| `common.py`, `summarize.py` | API helper and summary | `python summarize.py` (paid request) |
| `extract.py` | Typed extraction and CSV | `python extract.py` (paid request) |
| `make_pdf.py`, `sample-policy.pdf`, `pdf_qa.py` | Reproducible PDF and cited QA | `python make_pdf.py`, then `python pdf_qa.py` (QA is paid) |
| `knowledge.json`, `retrieve.py`, `rag.py` | Transparent keyword RAG | `python rag.py "missing payment reference" --dry-run` (local) |
| `sap-knowledge.json` | Fictional SAP-oriented source records | Add `--corpus sap-knowledge.json` with an appropriate question |
| `mcp_server.py` | SDK 1.x stdio tool server | Connect using the MCP guide; not a normal terminal chatbot |
| `cases.json`, `payment_rules.py` | Synthetic matching baseline | `python payment_rules.py` |
| `controls.py`, `test_controls.py` | Simulated review log and rejection checks | `python -m unittest test_controls.py -v` |
| `agent.py` | Two-request model/tool proposal | `python agent.py PAY-001` (paid) |
| `evaluate.py` | Offline rule evaluation | `python evaluate.py` (no API calls) |

`billing.py` is deliberately broken. Do not run all tests and interpret its intended failures as a packaging error. The testing post explains the repair; the control tests should pass unchanged.

`OPENAI_MODEL` defaults to `gpt-5.5`, a documented example as of the research date. Confirm account access and current pricing before a paid run. The model can be changed through the environment variable to a compatible available model. The extraction and agent examples require the relevant structured-output/tool capabilities.

API examples disable automatic retries and response storage, but those settings are not a universal spending cap or retention guarantee. Logs remain on your machine. The local review identity and JSON Lines audit file demonstrate a pattern and do not implement enterprise authentication or immutable logging.

## Validation limits

See [the validation report](../validation-report.md). Local parsing, rules, rejection tests, PDF fixture generation and extraction were exercised. Paid API responses, account sign-in, a live MCP client session, n8n Cloud and a real SAP tenant were not executed. Browser acceptance checks remain reader/reviewer steps unless explicitly recorded in that report.
