Skip to content
Open
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
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ inputs:
what you're doing."
required: true
default: ${{ github.workflow_ref }}-${{ github.action }}
app_url:
description: Specify a custom Braintrust app url
required: false

runs:
using: node20
Expand Down
38 changes: 19 additions & 19 deletions eval/dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions eval/dist/index.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions eval/src/braintrust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ export async function runEval(args: Params, onSummary: OnSummaryFn) {
let command: string;
const terminateFlag = terminate_on_failure ? "--terminate-on-failure" : "";

const appUrlFlag = args.app_url ? `--app-url ${args.app_url}` : "";

switch (args.runtime) {
case "node":
command = `npx braintrust eval --jsonl ${terminateFlag} ${paths}`;
command = `npx braintrust eval --jsonl ${terminateFlag} ${appUrlFlag} ${paths}`;
break;
case "python":
command = `braintrust eval --jsonl ${terminateFlag} ${paths}`;
command = `braintrust eval --jsonl ${terminateFlag} ${appUrlFlag} ${paths}`;
break;
default:
throw new Error(`Unsupported runtime: ${args.runtime}`);
Expand Down
2 changes: 2 additions & 0 deletions eval/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const paramsSchema = z.strictObject({
.transform(x => JSON.parse(x))
.pipe(z.boolean())
.default("false"),
app_url: z.string().optional(),
});
export type Params = z.infer<typeof paramsSchema>;

Expand All @@ -39,6 +40,7 @@ async function main(): Promise<void> {
runtime: core.getInput("runtime"),
use_proxy: core.getInput("use_proxy"),
terminate_on_failure: core.getInput("terminate_on_failure"),
app_url: core.getInput("app_url"),
});
if (!args.success) {
throw new Error(
Expand Down
Loading