deliberate-lab / scripts
AGENTS.md97 starsChanged 57 days agoApache-2.0View on GitHub
This directory contains the Deliberate Lab Python client — a pip-installable SDK for the REST API — plus a standalone Node.js diagnostic script. See also: root AGENTS.md for monorepo-wide conventions. types.py is generated from JSON schemas produced by the utils workspace. The full pipeline: To regenerate, run from the repository root: This builds utils, exports JSON schemas, then runs datamodel-codegen to produce Pydantic v2 models. Never edit types.py manually — your changes will be overwritten. [!NOTE] The pipeline requires utils…
- Reads credentials
- Installs packages
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- frontend/AGENTS.mdAGENTS.md
- functions/AGENTS.mdAGENTS.md
- utils/AGENTS.mdAGENTS.md
- eval-prSkill
- ghSkill
- pr-test-planSkill
- retrospectiveSkill
- workspace-overviewSkill
- workspace-syncSkill
The file
Files
AGENTS.md — scripts (Python Client)
This directory contains the Deliberate Lab Python client — a pip-installable SDK for the REST API — plus a standalone Node.js diagnostic script.
See also: root AGENTS.md for monorepo-wide conventions.
Package structure
| File | Purpose |
deliberate_lab/client.py | Client class — full REST API client |
deliberate_lab/types.py | ⚠️ Auto-generated Pydantic models — do not edit by hand |
deliberate_lab/__init__.py | Public API surface (Client, APIError, all types) |
update_schemas.sh | Schema regeneration pipeline (called by npm run update-schemas) |
doctor.js | Node.js health-check script: verifies Node version, config files, and build outputs (run via npm run doctor from repo root) |
⚠️ types.py is auto-generated
types.py is generated from JSON schemas produced by the utils workspace.
The full pipeline:
utils/src/export-schemas.ts → docs/assets/api/schemas.json → types.pyTo regenerate, run from the repository root:
npm run update-schemasThis builds utils, exports JSON schemas, then runs datamodel-codegen
to produce Pydantic v2 models. Never edit types.py manually — your
changes will be overwritten.
[!NOTE] The pipeline requires
utilsto be built first. If you have changedutilssource,npm run update-schemaswill rebuild it automatically via theupdate_schemas.shscript.
Build & test
Requires Python 3.12+ and uses uv for dependency management:
cd scripts
uv sync # Install dependencies
uv run pyright deliberate_lab/ # Type checkInstallation (as a user)
pip install git+https://github.com/PAIR-code/deliberate-lab.git#subdirectory=scriptsUsage
import deliberate_lab as dl
client = dl.Client() # Uses DL_API_KEY environment variable
experiments = client.list_experiments()
data = client.export_experiment("experiment-id")The Client class supports env="prod" or env="dev" (default) to
target production or local emulator endpoints.
REST API connection
The Python client in client.py is the SDK for the REST API implemented
in functions/src/dl_api/. When a new REST API endpoint is added, the
matching Python method should be added here. The API spec lives in
docs/assets/api/openapi.yaml.
functions/src/dl_api/ → docs/assets/api/openapi.yaml → client.py
(implementation) (API spec) (Python SDK)Testing
There are no automated tests for the Python client. The end-to-end schema
sync is validated by the CI schema check (see root AGENTS.md).
Common pitfalls
- Editing
types.pyby hand — this file is auto-generated and will be overwritten bynpm run update-schemas. Always modify the source types inutilsinstead. - Looking for Python tests — there are no automated tests for the
Python client yet. Do not create a
pytestconfiguration expecting existing tests to exist. - Running
uvfrom the repo root — unlikenpmcommands, Python tooling (uv,pyright) must be run from thescripts/directory wherepyproject.tomllives.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

