Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ uv add braintrust autoevals
pip install braintrust autoevals
```

Create `tutorial_eval.py`:
Create `eval_tutorial.py`:

```python
from autoevals import LevenshteinScorer
Expand All @@ -39,10 +39,10 @@ Eval(
)
```

Run it:
[Install the standalone `bt` CLI](https://github.com/braintrustdata/bt#install) and run:

```bash
BRAINTRUST_API_KEY=<YOUR_API_KEY> braintrust eval tutorial_eval.py
BRAINTRUST_API_KEY="YOUR_API_KEY" bt eval eval_tutorial.py
```

## Packages
Expand Down
8 changes: 5 additions & 3 deletions examples/evals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ Two minimal `Eval()` examples:

## Run

[Install the standalone `bt` CLI](https://github.com/braintrustdata/bt#install) and run from this directory:

```bash
export BRAINTRUST_API_KEY=...
export BRAINTRUST_API_KEY="YOUR_API_KEY"

uv sync
uv run braintrust eval simple_eval.py
uv run braintrust eval eval_example.py
bt eval simple_eval.py
bt eval eval_example.py
```

The second example is async, so the scorer prints span info to stdout as the eval runs.
6 changes: 3 additions & 3 deletions py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pip install braintrust

## Quickstart

Run a simple evaluation:
Save this evaluation as `eval_tutorial.py`:

```python
from braintrust import Eval
Expand All @@ -35,10 +35,10 @@ Eval(
)
```

Then run:
[Install the standalone `bt` CLI](https://github.com/braintrustdata/bt#install) and run:

```bash
BRAINTRUST_API_KEY=<YOUR_API_KEY> braintrust eval tutorial_eval.py
BRAINTRUST_API_KEY="YOUR_API_KEY" bt eval eval_tutorial.py
```

## Optional Extras
Expand Down
4 changes: 2 additions & 2 deletions py/src/braintrust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def is_equal(expected, output):
)
```

Finally, run the script with `braintrust eval eval_hello.py`.
[Install the standalone `bt` CLI](https://github.com/braintrustdata/bt#install) and run:

```bash
BRAINTRUST_API_KEY=<YOUR_BRAINTRUST_API_KEY> braintrust eval eval_hello.py
BRAINTRUST_API_KEY="YOUR_BRAINTRUST_API_KEY" bt eval eval_hello.py
```

### API Reference
Expand Down
6 changes: 3 additions & 3 deletions py/src/braintrust/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class Evaluator(Generic[Input, Output, Expected]):
optimal performance, it is recommended to provide asynchronous implementations).

You should not create Evaluators directly if you plan to use the Braintrust eval framework. Instead, you should
create them using the `Eval()` method, which will register them so that `braintrust eval ...` can find them.
create them using the `Eval()` method, which will register them so that `bt eval ...` can find them.
"""

project_name: str
Expand Down Expand Up @@ -584,7 +584,7 @@ class ReporterDef(SerializableDataClass, Generic[Input, Output, Expected, EvalRe
report_run: Callable[[list[EvalReport], bool, bool], bool | Awaitable[bool]]
"""
A function that takes all evaluator results and returns a boolean indicating whether the run was successful.
If you return false, the `braintrust eval` command will exit with a non-zero status code.
If you return false, the Python SDK's `braintrust eval` command will exit with a non-zero status code.
"""

async def _call_report_eval(
Expand Down Expand Up @@ -786,7 +786,7 @@ async def make_empty_summary():
else:
if isinstance(reporter, str):
raise ValueError(
"Must specify a reporter object, not a name. Can only specify reporter names when running 'braintrust eval'"
"Must specify a reporter object, not a name. Specify reporter names when running an eval from the CLI."
)

reporter = reporter or default_reporter
Expand Down
4 changes: 2 additions & 2 deletions py/src/braintrust/framework2.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def add_parameters(self, parameters: CodeParameters):

def publish(self):
if _is_lazy_load():
eprint(f"{bcolors.WARNING}publish() is a no-op when running `braintrust push`.{bcolors.ENDC}")
eprint(f"{bcolors.WARNING}publish() is a no-op when the CLI loads definitions.{bcolors.ENDC}")
return

login()
Expand All @@ -656,7 +656,7 @@ def publish(self):
definitions: list[dict[str, Any]] = []
if self._publishable_code_functions:
eprint(
f"{bcolors.WARNING}Code functions cannot be published directly. Use `braintrust push` instead.{bcolors.ENDC}"
f"{bcolors.WARNING}Code functions cannot be published directly. Use `bt functions push` instead.{bcolors.ENDC}"
)

for prompt in self._publishable_prompts:
Expand Down