Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for logging #35

Merged
merged 6 commits into from
Sep 28, 2024
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
65 changes: 58 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,64 @@ You can configure the following variables:
to `https://braintrustproxy.com/v1`, which will automatically cache repetitive
LLM calls and run your evals faster. Defaults to `true`.

## Full example

```yaml
name: Run pnpm evals

on:
push:
# Uncomment to run only when files in the 'evals' directory change
# - paths:
# - "evals/**"

permissions:
pull-requests: write
contents: read

jobs:
eval:
name: Run evals
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v3
with:
version: 8

- name: Install Dependencies
id: install
run: pnpm install

- name: Run Evals
uses: braintrustdata/eval-action@v1
with:
api_key: ${{ secrets.BRAINTRUST_API_KEY }}
runtime: node
root: my_eval_dir
```

> [!IMPORTANT]
> You must specify `permissions` for the action to leave comments on your PR.
> Without these permissions, you'll see Github API errors.

To see examples of fully configured templates, see the `examples` directory:

- [`node with npm`](examples/npm.yml)
- [`node with pnpm`](examples/pnpm.yml)

## How it works

The action runs `braintrust eval` and collects experiment results, which are
Expand All @@ -39,10 +97,3 @@ posted as a comment in the PR alongside a link to Braintrust. For example:
| ----------- | ----------- | -----------: | ----------: |
| Levenshtein | 0.83 (+3pp) | 8 🟢 | 4 🔴 |
| Duration | 1s (0s) | 16 🟢 | 1 🔴 |

## Example workflow templates

To see examples of fully configured templates, see the `examples` directory:

- [`node with npm`](examples/npm.yml)
- [`node with pnpm`](examples/pnpm.yml)
Loading