diff --git a/README.md b/README.md index e0a9cc737..9b0fbf98b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -39,10 +39,10 @@ Eval( ) ``` -Run it: +[Install the standalone `bt` CLI](https://github.com/braintrustdata/bt#install) and run: ```bash -BRAINTRUST_API_KEY= braintrust eval tutorial_eval.py +BRAINTRUST_API_KEY="YOUR_API_KEY" bt eval eval_tutorial.py ``` ## Packages diff --git a/examples/evals/README.md b/examples/evals/README.md index 6ee5e40d4..64227f118 100644 --- a/examples/evals/README.md +++ b/examples/evals/README.md @@ -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. diff --git a/py/README.md b/py/README.md index e87274450..368e6f150 100644 --- a/py/README.md +++ b/py/README.md @@ -14,7 +14,7 @@ pip install braintrust ## Quickstart -Run a simple evaluation: +Save this evaluation as `eval_tutorial.py`: ```python from braintrust import Eval @@ -35,10 +35,10 @@ Eval( ) ``` -Then run: +[Install the standalone `bt` CLI](https://github.com/braintrustdata/bt#install) and run: ```bash -BRAINTRUST_API_KEY= braintrust eval tutorial_eval.py +BRAINTRUST_API_KEY="YOUR_API_KEY" bt eval eval_tutorial.py ``` ## Optional Extras diff --git a/py/src/braintrust/__init__.py b/py/src/braintrust/__init__.py index 850d8e4bb..2fc7f362c 100644 --- a/py/src/braintrust/__init__.py +++ b/py/src/braintrust/__init__.py @@ -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= braintrust eval eval_hello.py +BRAINTRUST_API_KEY="YOUR_BRAINTRUST_API_KEY" bt eval eval_hello.py ``` ### API Reference diff --git a/py/src/braintrust/framework.py b/py/src/braintrust/framework.py index 08dc33a30..5fb8c3696 100644 --- a/py/src/braintrust/framework.py +++ b/py/src/braintrust/framework.py @@ -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 @@ -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( @@ -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 diff --git a/py/src/braintrust/framework2.py b/py/src/braintrust/framework2.py index 914ac5c9b..9e646d245 100644 --- a/py/src/braintrust/framework2.py +++ b/py/src/braintrust/framework2.py @@ -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() @@ -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: