diff --git a/README.md b/README.md index 49bf0247..fd67634a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ This repository contains Braintrust's Python SDKs and integrations, including: - The main `braintrust` SDK package in [`./py`](./py) - Built-in integrations under [`py/src/braintrust/integrations`](py/src/braintrust/integrations) and related compatibility packages under [`./integrations`](./integrations) -- Examples, tests, and local development tooling for Python SDK development +- Self-contained `uv`-project examples for every integration in [`./examples`](./examples) +- Tests and local development tooling for Python SDK development ## Quickstart diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 00000000..f0dac40e --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1,8 @@ +run.sh + +# Examples install fresh against current PyPI; locks aren't checked in. +uv.lock +.venv/ +__pycache__/ +*.pyc +.env diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 00000000..8a43ae4b --- /dev/null +++ b/examples/README.md @@ -0,0 +1,96 @@ +# Braintrust Python SDK Examples + +Each subdirectory in this folder is a self-contained [`uv`](https://docs.astral.sh/uv/) project demonstrating one Braintrust integration or feature. They are designed to be cloned, copied, or run as-is without affecting the rest of the repository. + +## Layout + +Every example has the same shape: + +``` +examples// +├── pyproject.toml # declares deps + a local `path` source for braintrust +├── README.md # what it shows + how to run it +└── *.py # the example script(s) +``` + +The `pyproject.toml` in each example pins `braintrust` to the local SDK checkout in `py/` via: + +```toml +[tool.uv.sources] +braintrust = { path = "../../py", editable = true } +``` + +That means `uv sync` inside any example installs the version of the SDK currently on disk — edits to `py/src/braintrust/` are picked up immediately. + +## Running an example + +From the repo root: + +```bash +cd examples/ +uv sync +uv run python