// support.eval.ts -> run with: bt eval support.eval.ts
import {
Eval
} from 'braintrust';
import {
Factuality
} from 'autoevals';
import {
answerQuestion
} from './agent';
Eval('Support Agent', {
experimentName: 'pr-check',
data: () => [{
input: 'How do I reset my password?',
expected: 'Settings > Security > Reset password'
},
{
input: 'Can I get a refund after 60 days?',
expected: 'No. Refunds are available for 30 days.'
},
],
task: async (input: string) => answerQuestion(input),
scores: [
Factuality, // LLM-as-judge: is the output consistent with expected?
({
output
}) => ({
name: 'under_400_chars',
score: output.length <= 400 ? 1 : 0, // deterministic code scorer
}),
],
});