@deepagents/evals 0.19.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/dataset/index.d.ts +3 -0
- package/dist/dataset/index.d.ts.map +1 -1
- package/dist/dataset/index.js +84 -1
- package/dist/dataset/index.js.map +3 -3
- package/dist/dataset/record-selection.d.ts +8 -0
- package/dist/dataset/record-selection.d.ts.map +1 -0
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +6 -3
- package/dist/engine/index.js.map +2 -2
- package/dist/evaluate/index.d.ts +16 -3
- package/dist/evaluate/index.d.ts.map +1 -1
- package/dist/evaluate/index.js +225 -359
- package/dist/evaluate/index.js.map +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +429 -110
- package/dist/index.js.map +4 -4
- package/dist/reporters/console.d.ts.map +1 -1
- package/dist/reporters/csv.d.ts.map +1 -1
- package/dist/reporters/html.d.ts.map +1 -1
- package/dist/reporters/index.js +129 -36
- package/dist/reporters/index.js.map +3 -3
- package/dist/reporters/markdown.d.ts.map +1 -1
- package/dist/scorers/index.d.ts +2 -6
- package/dist/scorers/index.d.ts.map +1 -1
- package/dist/scorers/index.js +32 -54
- package/dist/scorers/index.js.map +2 -2
- package/dist/store/index.d.ts +2 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +22 -0
- package/dist/store/index.js.map +2 -2
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/reporters/console.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAc,QAAQ,EAAc,SAAS,EAAE,MAAM,YAAY,CAAC;AAE9E,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/reporters/console.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAc,QAAQ,EAAc,SAAS,EAAE,MAAM,YAAY,CAAC;AAE9E,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAsBD,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,QAAQ,CAyD1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/reporters/csv.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/reporters/csv.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,QAAQ,CA+ClE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/reporters/html.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/reporters/html.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,QAAQ,CAMpE"}
|
package/dist/reporters/index.js
CHANGED
|
@@ -80,26 +80,51 @@ function createRunEndFileReporter(options) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
// packages/evals/src/reporters/console.ts
|
|
83
|
+
var BAR_WIDTH = 20;
|
|
84
|
+
function renderProgressBar(completed, total, elapsedMs) {
|
|
85
|
+
const pct = total > 0 ? completed / total : 0;
|
|
86
|
+
const filled = Math.round(pct * BAR_WIDTH);
|
|
87
|
+
const bar = "\u2593".repeat(filled) + "\u2591".repeat(BAR_WIDTH - filled);
|
|
88
|
+
const pctStr = `${(pct * 100).toFixed(0)}%`;
|
|
89
|
+
return ` ${bar} ${pctStr} (${completed}/${total}) ${formatDuration(elapsedMs)}`;
|
|
90
|
+
}
|
|
91
|
+
function statusLabel(status) {
|
|
92
|
+
if (status === "pass") return chalk.green("PASS");
|
|
93
|
+
if (status === "error") return chalk.yellow("ERROR");
|
|
94
|
+
return chalk.red("FAIL");
|
|
95
|
+
}
|
|
83
96
|
function consoleReporter(options) {
|
|
84
97
|
const verbosity = options?.verbosity ?? "normal";
|
|
85
98
|
let totalCases = 0;
|
|
86
99
|
let completed = 0;
|
|
100
|
+
let startTime = 0;
|
|
87
101
|
return {
|
|
88
102
|
onRunStart(data) {
|
|
89
103
|
totalCases = data.totalCases;
|
|
90
104
|
completed = 0;
|
|
105
|
+
startTime = Date.now();
|
|
106
|
+
if (verbosity !== "quiet") {
|
|
107
|
+
const label = data.name;
|
|
108
|
+
console.log("");
|
|
109
|
+
console.log(
|
|
110
|
+
` ${chalk.dim("\u2500\u2500")} ${chalk.bold(label)} ${chalk.dim("\u2500".repeat(Math.max(0, 56 - label.length)))}`
|
|
111
|
+
);
|
|
112
|
+
console.log(` ${chalk.dim(`Running ${data.totalCases} cases...`)}`);
|
|
113
|
+
console.log("");
|
|
114
|
+
}
|
|
91
115
|
},
|
|
92
116
|
onCaseEnd() {
|
|
93
117
|
completed++;
|
|
94
118
|
if (verbosity !== "quiet") {
|
|
119
|
+
const elapsed = Date.now() - startTime;
|
|
95
120
|
process.stdout.write(
|
|
96
|
-
`\r
|
|
121
|
+
`\r${renderProgressBar(completed, totalCases, elapsed)}`
|
|
97
122
|
);
|
|
98
123
|
}
|
|
99
124
|
},
|
|
100
125
|
onRunEnd(data) {
|
|
101
126
|
if (verbosity !== "quiet") {
|
|
102
|
-
process.stdout.write("\r" + " ".repeat(
|
|
127
|
+
process.stdout.write("\r" + " ".repeat(70) + "\r");
|
|
103
128
|
}
|
|
104
129
|
renderSummaryTable(data);
|
|
105
130
|
if (verbosity === "quiet") return;
|
|
@@ -112,19 +137,7 @@ function consoleReporter(options) {
|
|
|
112
137
|
});
|
|
113
138
|
}
|
|
114
139
|
} else {
|
|
115
|
-
|
|
116
|
-
(c) => getCaseStatus(c, data.threshold) !== "pass"
|
|
117
|
-
);
|
|
118
|
-
if (failing.length > 0) {
|
|
119
|
-
console.log(chalk.dim(` Failing cases (${failing.length}):`));
|
|
120
|
-
console.log("");
|
|
121
|
-
for (const c of failing) {
|
|
122
|
-
renderCaseDetail(c, data.threshold, {
|
|
123
|
-
includeIO: true,
|
|
124
|
-
maxStringLength: 4e3
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
140
|
+
renderFailuresByScorer(sorted, data.threshold);
|
|
128
141
|
}
|
|
129
142
|
}
|
|
130
143
|
};
|
|
@@ -137,40 +150,69 @@ function truncateString(text, maxLength) {
|
|
|
137
150
|
if (text.length <= maxLength) return text;
|
|
138
151
|
return text.slice(0, maxLength) + "\u2026";
|
|
139
152
|
}
|
|
153
|
+
function stringifyRationale(value) {
|
|
154
|
+
if (typeof value === "string") {
|
|
155
|
+
const trimmed = value.trim();
|
|
156
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
157
|
+
}
|
|
158
|
+
if (Array.isArray(value)) {
|
|
159
|
+
const parts = value.map((item) => typeof item === "string" ? item.trim() : "").filter(Boolean);
|
|
160
|
+
if (parts.length > 0) return parts.join(" | ");
|
|
161
|
+
}
|
|
162
|
+
return void 0;
|
|
163
|
+
}
|
|
164
|
+
function scoreReasonWithMetadata(score) {
|
|
165
|
+
const reason = score.reason?.trim();
|
|
166
|
+
if (reason) return reason;
|
|
167
|
+
return stringifyRationale(score.metadata?.["rationale"]);
|
|
168
|
+
}
|
|
140
169
|
function renderSummaryTable(data) {
|
|
141
170
|
const { summary } = data;
|
|
142
|
-
const
|
|
171
|
+
const passRate = summary.totalCases > 0 ? (summary.passCount / summary.totalCases * 100).toFixed(1) : "0.0";
|
|
143
172
|
console.log("");
|
|
144
173
|
console.log(chalk.bold(" Summary"));
|
|
145
174
|
console.log(chalk.dim(" " + "\u2500".repeat(60)));
|
|
146
|
-
console.log(` ${chalk.dim("Eval:")}
|
|
147
|
-
console.log(` ${chalk.dim("Model:")}
|
|
148
|
-
console.log(` ${chalk.dim("
|
|
175
|
+
console.log(` ${chalk.dim("Eval:")} ${data.name}`);
|
|
176
|
+
console.log(` ${chalk.dim("Model:")} ${data.model}`);
|
|
177
|
+
console.log(` ${chalk.dim("Threshold:")} ${data.threshold}`);
|
|
178
|
+
console.log(` ${chalk.dim("Cases:")} ${summary.totalCases}`);
|
|
149
179
|
console.log(
|
|
150
|
-
` ${chalk.dim("Pass/Fail:")} ${chalk.green(String(summary.passCount))} / ${chalk.red(String(summary.failCount))}`
|
|
180
|
+
` ${chalk.dim("Pass/Fail:")} ${chalk.green(String(summary.passCount))} / ${chalk.red(String(summary.failCount))} ${chalk.dim(`(${passRate}%)`)}`
|
|
151
181
|
);
|
|
152
|
-
console.log(` ${chalk.dim("Scores:")} ${scoreStr}`);
|
|
153
182
|
console.log(
|
|
154
|
-
` ${chalk.dim("Duration:")}
|
|
183
|
+
` ${chalk.dim("Duration:")} ${formatDuration(summary.totalLatencyMs)}`
|
|
155
184
|
);
|
|
156
185
|
console.log(
|
|
157
|
-
` ${chalk.dim("Tokens:")}
|
|
186
|
+
` ${chalk.dim("Tokens:")} ${chalk.dim("In:")} ${formatTokens(summary.totalTokensIn)} ${chalk.dim("Out:")} ${formatTokens(summary.totalTokensOut)} ${chalk.dim("Total:")} ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}`
|
|
158
187
|
);
|
|
188
|
+
const scoreEntries = Object.entries(summary.meanScores);
|
|
189
|
+
if (scoreEntries.length > 0) {
|
|
190
|
+
console.log("");
|
|
191
|
+
console.log(chalk.bold(" Scores"));
|
|
192
|
+
for (const [name, score] of scoreEntries) {
|
|
193
|
+
const scoreColor = score >= data.threshold ? chalk.green : chalk.red;
|
|
194
|
+
console.log(
|
|
195
|
+
` ${chalk.dim(name + ":")}${" ".repeat(Math.max(1, 12 - name.length))}${scoreColor(score.toFixed(3))}`
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
159
199
|
console.log(chalk.dim(" " + "\u2500".repeat(60)));
|
|
160
200
|
console.log("");
|
|
161
201
|
}
|
|
162
202
|
function renderCaseDetail(c, threshold, options) {
|
|
163
203
|
const entries = Object.entries(c.scores);
|
|
164
|
-
const
|
|
165
|
-
const prefix =
|
|
204
|
+
const status = getCaseStatus(c, threshold);
|
|
205
|
+
const prefix = statusLabel(status);
|
|
166
206
|
const includeIO = options?.includeIO ?? false;
|
|
167
207
|
const maxStringLength = options?.maxStringLength ?? 4e3;
|
|
168
|
-
|
|
208
|
+
const meta = `${chalk.dim(formatDuration(c.latencyMs))} ${chalk.dim(`${c.tokensIn}/${c.tokensOut} tokens`)}`;
|
|
209
|
+
console.log(` ${prefix} ${chalk.dim(`Case #${c.index}`)} ${meta}`);
|
|
169
210
|
const inputStr = stringifyUnknown(c.input, {
|
|
170
211
|
space: 2,
|
|
171
212
|
fallback: String(c.input)
|
|
172
213
|
});
|
|
173
|
-
console.log(` ${chalk.dim("Input:")}
|
|
214
|
+
console.log(` ${chalk.dim("Input:")}`);
|
|
215
|
+
console.log(indentBlock(truncateString(inputStr, maxStringLength), 6));
|
|
174
216
|
if (includeIO) {
|
|
175
217
|
console.log(` ${chalk.dim("Output:")}`);
|
|
176
218
|
console.log(indentBlock(truncateString(c.output, maxStringLength), 6));
|
|
@@ -185,7 +227,8 @@ function renderCaseDetail(c, threshold, options) {
|
|
|
185
227
|
}
|
|
186
228
|
for (const [name, s] of entries) {
|
|
187
229
|
const scoreColor = s.score >= threshold ? chalk.green : chalk.red;
|
|
188
|
-
const
|
|
230
|
+
const reason = scoreReasonWithMetadata(s);
|
|
231
|
+
const reasonStr = reason ? ` \u2014 ${reason}` : "";
|
|
189
232
|
console.log(
|
|
190
233
|
` ${chalk.dim(name + ":")} ${scoreColor(s.score.toFixed(3))}${reasonStr}`
|
|
191
234
|
);
|
|
@@ -197,6 +240,37 @@ function renderCaseDetail(c, threshold, options) {
|
|
|
197
240
|
}
|
|
198
241
|
console.log("");
|
|
199
242
|
}
|
|
243
|
+
function renderFailuresByScorer(cases, threshold) {
|
|
244
|
+
const scorerNames = /* @__PURE__ */ new Set();
|
|
245
|
+
for (const c of cases) {
|
|
246
|
+
for (const name of Object.keys(c.scores)) {
|
|
247
|
+
scorerNames.add(name);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
let hasFailures = false;
|
|
251
|
+
for (const scorer of scorerNames) {
|
|
252
|
+
const failing = cases.filter((c) => {
|
|
253
|
+
const s = c.scores[scorer];
|
|
254
|
+
return s && s.score < threshold || getCaseStatus(c, threshold) === "error";
|
|
255
|
+
});
|
|
256
|
+
if (failing.length === 0) continue;
|
|
257
|
+
if (!hasFailures) {
|
|
258
|
+
console.log(chalk.dim(" Failing by scorer:"));
|
|
259
|
+
console.log("");
|
|
260
|
+
hasFailures = true;
|
|
261
|
+
}
|
|
262
|
+
console.log(
|
|
263
|
+
` ${chalk.bold(scorer)} ${chalk.dim(`(${failing.length} failures)`)}`
|
|
264
|
+
);
|
|
265
|
+
console.log(chalk.dim(" " + "\u2500".repeat(40)));
|
|
266
|
+
for (const c of failing) {
|
|
267
|
+
renderCaseDetail(c, threshold, {
|
|
268
|
+
includeIO: true,
|
|
269
|
+
maxStringLength: 4e3
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
200
274
|
|
|
201
275
|
// packages/evals/src/reporters/json.ts
|
|
202
276
|
import { appendFile, mkdir as mkdir2 } from "node:fs/promises";
|
|
@@ -238,6 +312,7 @@ function csvReporter(options) {
|
|
|
238
312
|
const scorerNames = Object.keys(data.summary.meanScores);
|
|
239
313
|
const headerParts = [
|
|
240
314
|
"index",
|
|
315
|
+
"status",
|
|
241
316
|
"input",
|
|
242
317
|
"output",
|
|
243
318
|
"expected",
|
|
@@ -251,8 +326,10 @@ function csvReporter(options) {
|
|
|
251
326
|
}
|
|
252
327
|
const rows = [headerParts.join(",")];
|
|
253
328
|
for (const c of data.cases) {
|
|
329
|
+
const status = getCaseStatus(c, data.threshold);
|
|
254
330
|
const parts = [
|
|
255
331
|
String(c.index),
|
|
332
|
+
status,
|
|
256
333
|
escapeCsv(c.input),
|
|
257
334
|
escapeCsv(c.output),
|
|
258
335
|
escapeCsv(c.expected),
|
|
@@ -281,15 +358,17 @@ function markdownReporter(options) {
|
|
|
281
358
|
const { summary } = data;
|
|
282
359
|
const scorerNames = Object.keys(summary.meanScores);
|
|
283
360
|
const lines = [];
|
|
361
|
+
const passRate = summary.totalCases > 0 ? (summary.passCount / summary.totalCases * 100).toFixed(1) : "0.0";
|
|
284
362
|
lines.push(`# ${data.name}`);
|
|
285
363
|
lines.push("");
|
|
286
364
|
lines.push(`**Model:** ${data.model}`);
|
|
365
|
+
lines.push(`**Threshold:** ${data.threshold}`);
|
|
287
366
|
lines.push(
|
|
288
|
-
`**Cases:** ${summary.totalCases} (${summary.passCount} pass, ${summary.failCount} fail)`
|
|
367
|
+
`**Cases:** ${summary.totalCases} (${summary.passCount} pass, ${summary.failCount} fail, ${passRate}%)`
|
|
289
368
|
);
|
|
290
369
|
lines.push(`**Duration:** ${formatDuration(summary.totalLatencyMs)}`);
|
|
291
370
|
lines.push(
|
|
292
|
-
`**Tokens:** ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}`
|
|
371
|
+
`**Tokens:** In: ${formatTokens(summary.totalTokensIn)} | Out: ${formatTokens(summary.totalTokensOut)} | Total: ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}`
|
|
293
372
|
);
|
|
294
373
|
lines.push("");
|
|
295
374
|
lines.push("## Scores");
|
|
@@ -308,6 +387,7 @@ function markdownReporter(options) {
|
|
|
308
387
|
"Input",
|
|
309
388
|
...scorerNames,
|
|
310
389
|
"Latency",
|
|
390
|
+
"Tokens",
|
|
311
391
|
"Error"
|
|
312
392
|
];
|
|
313
393
|
lines.push(`| ${caseHeader.join(" | ")} |`);
|
|
@@ -325,7 +405,8 @@ function markdownReporter(options) {
|
|
|
325
405
|
status,
|
|
326
406
|
input,
|
|
327
407
|
...scores,
|
|
328
|
-
|
|
408
|
+
formatDuration(c.latencyMs),
|
|
409
|
+
`${c.tokensIn}/${c.tokensOut}`,
|
|
329
410
|
error
|
|
330
411
|
];
|
|
331
412
|
lines.push(`| ${row.join(" | ")} |`);
|
|
@@ -350,9 +431,10 @@ function esc(str) {
|
|
|
350
431
|
function renderHtml(data) {
|
|
351
432
|
const { summary } = data;
|
|
352
433
|
const scorerNames = Object.keys(summary.meanScores);
|
|
434
|
+
const passRate = summary.totalCases > 0 ? (summary.passCount / summary.totalCases * 100).toFixed(1) : "0.0";
|
|
353
435
|
const caseRows = data.cases.map((c) => {
|
|
354
436
|
const status = getCaseStatus(c, data.threshold);
|
|
355
|
-
const
|
|
437
|
+
const statusLabel2 = status === "error" ? "ERROR" : status === "pass" ? "PASS" : "FAIL";
|
|
356
438
|
const scoresCells = scorerNames.map((name) => {
|
|
357
439
|
const s = c.scores[name];
|
|
358
440
|
const score = s?.score ?? 0;
|
|
@@ -360,13 +442,19 @@ function renderHtml(data) {
|
|
|
360
442
|
const reason = s?.reason ? ` title="${esc(s.reason)}"` : "";
|
|
361
443
|
return `<td class="${cls}"${reason}>${score.toFixed(3)}</td>`;
|
|
362
444
|
}).join("");
|
|
445
|
+
const expectedStr = stringifyUnknown(c.expected, {
|
|
446
|
+
space: 0,
|
|
447
|
+
fallback: ""
|
|
448
|
+
});
|
|
363
449
|
return `<tr class="${status}">
|
|
364
450
|
<td>${c.index}</td>
|
|
365
|
-
<td class="${status}">${
|
|
451
|
+
<td class="${status}">${statusLabel2}</td>
|
|
366
452
|
<td class="text">${esc(formatInputValue(c.input).slice(0, 120))}</td>
|
|
367
453
|
<td class="text">${esc(c.output.slice(0, 120))}</td>
|
|
454
|
+
<td class="text">${esc(expectedStr.slice(0, 120))}</td>
|
|
368
455
|
${scoresCells}
|
|
369
|
-
<td>${c.latencyMs}
|
|
456
|
+
<td>${formatDuration(c.latencyMs)}</td>
|
|
457
|
+
<td>${c.tokensIn}/${c.tokensOut}</td>
|
|
370
458
|
<td class="error-text">${c.error ? esc(formatErrorValue(c.error)) : ""}</td>
|
|
371
459
|
</tr>`;
|
|
372
460
|
}).join("\n");
|
|
@@ -404,11 +492,14 @@ function renderHtml(data) {
|
|
|
404
492
|
<h1>${esc(data.name)}</h1>
|
|
405
493
|
<div class="meta">
|
|
406
494
|
<span><strong>Model:</strong> ${esc(data.model)}</span>
|
|
495
|
+
<span><strong>Threshold:</strong> ${data.threshold}</span>
|
|
407
496
|
<span><strong>Cases:</strong> ${summary.totalCases}</span>
|
|
408
497
|
<span><strong>Pass:</strong> ${summary.passCount}</span>
|
|
409
|
-
<span><strong>Fail:</strong> ${summary.failCount}</span>
|
|
498
|
+
<span><strong>Fail:</strong> ${summary.failCount} (${passRate}%)</span>
|
|
410
499
|
<span><strong>Duration:</strong> ${formatDuration(summary.totalLatencyMs)}</span>
|
|
411
|
-
<span><strong>Tokens:</strong> ${formatTokens(summary.totalTokensIn
|
|
500
|
+
<span><strong>Tokens In:</strong> ${formatTokens(summary.totalTokensIn)}</span>
|
|
501
|
+
<span><strong>Tokens Out:</strong> ${formatTokens(summary.totalTokensOut)}</span>
|
|
502
|
+
<span><strong>Total Tokens:</strong> ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}</span>
|
|
412
503
|
</div>
|
|
413
504
|
|
|
414
505
|
<h2>Mean Scores</h2>
|
|
@@ -425,8 +516,10 @@ function renderHtml(data) {
|
|
|
425
516
|
<th>Status</th>
|
|
426
517
|
<th>Input</th>
|
|
427
518
|
<th>Output</th>
|
|
519
|
+
<th>Expected</th>
|
|
428
520
|
${scorerHeaders}
|
|
429
521
|
<th>Latency</th>
|
|
522
|
+
<th>Tokens</th>
|
|
430
523
|
<th>Error</th>
|
|
431
524
|
</tr>
|
|
432
525
|
</thead>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/reporters/console.ts", "../../src/reporters/format.ts", "../../src/reporters/shared.ts", "../../src/reporters/json.ts", "../../src/reporters/csv.ts", "../../src/reporters/markdown.ts", "../../src/reporters/html.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk';\n\nimport {\n formatDuration,\n formatErrorValue,\n formatTokens,\n stringifyUnknown,\n} from './format.ts';\nimport { getCaseStatus } from './shared.ts';\nimport type { CaseResult, Reporter, RunEndData, Verbosity } from './types.ts';\n\nexport interface ConsoleReporterOptions {\n verbosity?: Verbosity;\n}\n\nexport function consoleReporter(options?: ConsoleReporterOptions): Reporter {\n const verbosity = options?.verbosity ?? 'normal';\n\n let totalCases = 0;\n let completed = 0;\n\n return {\n onRunStart(data) {\n totalCases = data.totalCases;\n completed = 0;\n },\n\n onCaseEnd() {\n completed++;\n if (verbosity !== 'quiet') {\n process.stdout.write(\n `\\r ${chalk.dim(`[${completed}/${totalCases}]`)}`,\n );\n }\n },\n\n onRunEnd(data) {\n if (verbosity !== 'quiet') {\n process.stdout.write('\\r' + ' '.repeat(30) + '\\r');\n }\n\n renderSummaryTable(data);\n\n if (verbosity === 'quiet') return;\n\n const sorted = [...data.cases].sort((a, b) => a.index - b.index);\n\n if (verbosity === 'verbose') {\n for (const c of sorted) {\n renderCaseDetail(c, data.threshold, {\n includeIO: true,\n maxStringLength: 20_000,\n });\n }\n } else {\n const failing = sorted.filter(\n (c) => getCaseStatus(c, data.threshold) !== 'pass',\n );\n if (failing.length > 0) {\n console.log(chalk.dim(` Failing cases (${failing.length}):`));\n console.log('');\n for (const c of failing) {\n renderCaseDetail(c, data.threshold, {\n includeIO: true,\n maxStringLength: 4_000,\n });\n }\n }\n }\n },\n };\n}\n\nfunction indentBlock(text: string, spaces: number): string {\n const pad = ' '.repeat(spaces);\n return text\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n .map((line) => pad + line)\n .join('\\n');\n}\n\nfunction truncateString(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return text.slice(0, maxLength) + '\u2026';\n}\n\nfunction renderSummaryTable(data: RunEndData): void {\n const { summary } = data;\n const scoreStr = Object.entries(summary.meanScores)\n .map(([name, score]) => `${name}: ${score.toFixed(3)}`)\n .join(', ');\n\n console.log('');\n console.log(chalk.bold(' Summary'));\n console.log(chalk.dim(' ' + '\u2500'.repeat(60)));\n console.log(` ${chalk.dim('Eval:')} ${data.name}`);\n console.log(` ${chalk.dim('Model:')} ${data.model}`);\n console.log(` ${chalk.dim('Cases:')} ${summary.totalCases}`);\n console.log(\n ` ${chalk.dim('Pass/Fail:')} ${chalk.green(String(summary.passCount))} / ${chalk.red(String(summary.failCount))}`,\n );\n console.log(` ${chalk.dim('Scores:')} ${scoreStr}`);\n console.log(\n ` ${chalk.dim('Duration:')} ${formatDuration(summary.totalLatencyMs)}`,\n );\n console.log(\n ` ${chalk.dim('Tokens:')} ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}`,\n );\n console.log(chalk.dim(' ' + '\u2500'.repeat(60)));\n console.log('');\n}\n\nfunction renderCaseDetail(\n c: CaseResult,\n threshold: number,\n options?: {\n includeIO?: boolean;\n maxStringLength?: number;\n },\n): void {\n const entries = Object.entries(c.scores);\n const failed = entries.some(([, s]) => s.score < threshold);\n const prefix = failed ? chalk.red('FAIL') : chalk.green('PASS');\n const includeIO = options?.includeIO ?? false;\n const maxStringLength = options?.maxStringLength ?? 4_000;\n\n console.log(` ${prefix} ${chalk.dim(`Case #${c.index}`)}`);\n const inputStr = stringifyUnknown(c.input, {\n space: 2,\n fallback: String(c.input),\n });\n console.log(` ${chalk.dim('Input:')} ${inputStr}`);\n\n if (includeIO) {\n console.log(` ${chalk.dim('Output:')}`);\n console.log(indentBlock(truncateString(c.output, maxStringLength), 6));\n console.log(` ${chalk.dim('Expected:')}`);\n const expectedStrRaw = stringifyUnknown(c.expected, {\n space: 2,\n fallback: String(c.expected),\n });\n console.log(\n indentBlock(truncateString(expectedStrRaw, maxStringLength), 6),\n );\n }\n\n for (const [name, s] of entries) {\n const scoreColor = s.score >= threshold ? chalk.green : chalk.red;\n const reasonStr = s.reason ? ` \u2014 ${s.reason}` : '';\n console.log(\n ` ${chalk.dim(name + ':')} ${scoreColor(s.score.toFixed(3))}${reasonStr}`,\n );\n }\n\n if (c.error) {\n console.log(` ${chalk.dim('Error:')}`);\n const errorStr = formatErrorValue(c.error);\n console.log(` ${chalk.red(errorStr)}`);\n }\n\n console.log('');\n}\n", "export function truncate(str: string, maxLen = 80): string {\n if (str.length <= maxLen) return str;\n return str.slice(0, maxLen) + '...';\n}\n\nexport function formatDuration(ms: number): string {\n if (ms < 1000) return `${ms}ms`;\n return `${(ms / 1000).toFixed(1)}s`;\n}\n\nexport function formatTokens(n: number): string {\n if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;\n if (n >= 1_000) return `${(n / 1_000).toFixed(0)}k`;\n return String(n);\n}\n\nexport function generateFilename(\n name: string,\n runId: string,\n ext: string,\n): string {\n const slug = name.replace(/[^a-zA-Z0-9-_]/g, '-').toLowerCase();\n const prefix = runId.slice(0, 8);\n return `${slug}-${prefix}.${ext}`;\n}\n\nexport function stringifyUnknown(\n value: unknown,\n options?: {\n space?: number;\n fallback?: string;\n },\n): string {\n if (typeof value === 'string') return value;\n\n const space = options?.space ?? 0;\n const fallback = options?.fallback ?? 'null';\n try {\n return JSON.stringify(value, null, space) ?? fallback;\n } catch {\n return String(value);\n }\n}\n\nexport function formatInputValue(value: unknown): string {\n return stringifyUnknown(value, { space: 0, fallback: '' });\n}\n\nexport function formatErrorValue(value: unknown): string {\n if (value == null) return '';\n if (typeof value === 'string') return value;\n return stringifyUnknown(value, { space: 2, fallback: '' });\n}\n\nexport function escapeCsv(value: unknown): string {\n const str = stringifyUnknown(value, { space: 0, fallback: 'null' });\n if (str.includes(',') || str.includes('\"') || str.includes('\\n')) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`;\n }\n return str;\n}\n", "import { mkdir, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport { generateFilename } from './format.ts';\nimport type { CaseResult, Reporter, RunEndData } from './types.ts';\n\nconst DEFAULT_OUTPUT_DIR = '.evals/reports';\n\nexport function resolveOutputDir(outputDir?: string): string {\n return outputDir ?? DEFAULT_OUTPUT_DIR;\n}\n\nexport function getReportPath(\n outputDir: string,\n name: string,\n runId: string,\n ext: string,\n): string {\n return join(outputDir, generateFilename(name, runId, ext));\n}\n\nexport async function writeRunReportFile(\n outputDir: string,\n name: string,\n runId: string,\n ext: string,\n content: string,\n): Promise<void> {\n await mkdir(outputDir, { recursive: true });\n await writeFile(getReportPath(outputDir, name, runId, ext), content, 'utf-8');\n}\n\nexport function getCaseStatus(\n result: CaseResult,\n threshold: number,\n): 'error' | 'pass' | 'fail' {\n if (result.error) return 'error';\n const passed = Object.values(result.scores).every(\n (s) => s.score >= threshold,\n );\n return passed ? 'pass' : 'fail';\n}\n\nexport function createRunEndFileReporter(options: {\n outputDir?: string;\n ext: string;\n render: (data: RunEndData) => string | Promise<string>;\n}): Reporter {\n const outputDir = resolveOutputDir(options.outputDir);\n\n return {\n async onRunEnd(data) {\n const content = await options.render(data);\n await writeRunReportFile(\n outputDir,\n data.name,\n data.runId,\n options.ext,\n content,\n );\n },\n };\n}\n", "import { appendFile, mkdir } from 'node:fs/promises';\n\nimport { stringifyUnknown } from './format.ts';\nimport {\n getReportPath,\n resolveOutputDir,\n writeRunReportFile,\n} from './shared.ts';\nimport type { Reporter } from './types.ts';\n\nexport interface JsonReporterOptions {\n outputDir?: string;\n pretty?: boolean;\n}\n\nexport function jsonReporter(options?: JsonReporterOptions): Reporter {\n const outputDir = resolveOutputDir(options?.outputDir);\n const pretty = options?.pretty ?? true;\n let streamFilename = '';\n\n return {\n async onRunStart(data) {\n await mkdir(outputDir, { recursive: true });\n streamFilename = getReportPath(outputDir, data.name, data.runId, 'jsonl');\n },\n async onCaseEnd(data) {\n const line = stringifyUnknown(data, { space: 0, fallback: 'null' });\n await appendFile(streamFilename, line + '\\n', 'utf-8');\n },\n async onRunEnd(data) {\n const content = stringifyUnknown(data, {\n space: pretty ? 2 : 0,\n fallback: 'null',\n });\n await writeRunReportFile(\n outputDir,\n data.name,\n data.runId,\n 'json',\n content,\n );\n },\n };\n}\n", "import { escapeCsv } from './format.ts';\nimport { createRunEndFileReporter } from './shared.ts';\nimport type { Reporter } from './types.ts';\n\nexport interface CsvReporterOptions {\n outputDir?: string;\n}\n\nexport function csvReporter(options?: CsvReporterOptions): Reporter {\n return createRunEndFileReporter({\n outputDir: options?.outputDir,\n ext: 'csv',\n render(data) {\n const scorerNames = Object.keys(data.summary.meanScores);\n\n const headerParts = [\n 'index',\n 'input',\n 'output',\n 'expected',\n 'error',\n 'latency_ms',\n 'tokens_in',\n 'tokens_out',\n ];\n for (const name of scorerNames) {\n headerParts.push(`${name}_score`, `${name}_reason`);\n }\n\n const rows = [headerParts.join(',')];\n\n for (const c of data.cases) {\n const parts = [\n String(c.index),\n escapeCsv(c.input),\n escapeCsv(c.output),\n escapeCsv(c.expected),\n escapeCsv(c.error ?? ''),\n String(c.latencyMs),\n String(c.tokensIn),\n String(c.tokensOut),\n ];\n for (const name of scorerNames) {\n const s = c.scores[name];\n parts.push(String(s?.score ?? ''), escapeCsv(s?.reason ?? ''));\n }\n rows.push(parts.join(','));\n }\n\n return rows.join('\\n') + '\\n';\n },\n });\n}\n", "import {\n formatDuration,\n formatErrorValue,\n formatInputValue,\n formatTokens,\n} from './format.ts';\nimport { createRunEndFileReporter, getCaseStatus } from './shared.ts';\nimport type { Reporter } from './types.ts';\n\nexport interface MarkdownReporterOptions {\n outputDir?: string;\n}\n\nexport function markdownReporter(options?: MarkdownReporterOptions): Reporter {\n return createRunEndFileReporter({\n outputDir: options?.outputDir,\n ext: 'md',\n render(data) {\n const { summary } = data;\n const scorerNames = Object.keys(summary.meanScores);\n const lines: string[] = [];\n\n lines.push(`# ${data.name}`);\n lines.push('');\n lines.push(`**Model:** ${data.model}`);\n lines.push(\n `**Cases:** ${summary.totalCases} (${summary.passCount} pass, ${summary.failCount} fail)`,\n );\n lines.push(`**Duration:** ${formatDuration(summary.totalLatencyMs)}`);\n lines.push(\n `**Tokens:** ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}`,\n );\n lines.push('');\n\n lines.push('## Scores');\n lines.push('');\n lines.push('| Scorer | Mean |');\n lines.push('|--------|------|');\n for (const [name, score] of Object.entries(summary.meanScores)) {\n lines.push(`| ${name} | ${score.toFixed(3)} |`);\n }\n lines.push('');\n\n lines.push('## Cases');\n lines.push('');\n\n const caseHeader = [\n '#',\n 'Status',\n 'Input',\n ...scorerNames,\n 'Latency',\n 'Error',\n ];\n lines.push(`| ${caseHeader.join(' | ')} |`);\n lines.push(`| ${caseHeader.map(() => '---').join(' | ')} |`);\n\n for (const c of data.cases) {\n const statusValue = getCaseStatus(c, data.threshold);\n const status =\n statusValue === 'error'\n ? '\uD83D\uDD34 Error'\n : statusValue === 'pass'\n ? '\u2705 Pass'\n : '\u274C Fail';\n const input = formatInputValue(c.input).slice(0, 60);\n const scores = scorerNames.map(\n (name) => c.scores[name]?.score.toFixed(3) ?? '-',\n );\n const error = c.error\n ? formatErrorValue(c.error)\n .replace(/\\r?\\n/g, '<br>')\n .replace(/\\|/g, '\\\\|')\n : '-';\n const row = [\n String(c.index),\n status,\n input,\n ...scores,\n `${c.latencyMs}ms`,\n error,\n ];\n lines.push(`| ${row.join(' | ')} |`);\n }\n lines.push('');\n\n return lines.join('\\n');\n },\n });\n}\n", "import {\n formatDuration,\n formatErrorValue,\n formatInputValue,\n formatTokens,\n} from './format.ts';\nimport { createRunEndFileReporter, getCaseStatus } from './shared.ts';\nimport type { Reporter, RunEndData } from './types.ts';\n\nexport interface HtmlReporterOptions {\n outputDir?: string;\n}\n\nexport function htmlReporter(options?: HtmlReporterOptions): Reporter {\n return createRunEndFileReporter({\n outputDir: options?.outputDir,\n ext: 'html',\n render: renderHtml,\n });\n}\n\nfunction esc(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n\nfunction renderHtml(data: RunEndData): string {\n const { summary } = data;\n const scorerNames = Object.keys(summary.meanScores);\n\n const caseRows = data.cases\n .map((c) => {\n const status = getCaseStatus(c, data.threshold);\n const statusLabel =\n status === 'error' ? 'ERROR' : status === 'pass' ? 'PASS' : 'FAIL';\n const scoresCells = scorerNames\n .map((name) => {\n const s = c.scores[name];\n const score = s?.score ?? 0;\n const cls = score >= data.threshold ? 'pass' : 'fail';\n const reason = s?.reason ? ` title=\"${esc(s.reason)}\"` : '';\n return `<td class=\"${cls}\"${reason}>${score.toFixed(3)}</td>`;\n })\n .join('');\n\n return `<tr class=\"${status}\">\n <td>${c.index}</td>\n <td class=\"${status}\">${statusLabel}</td>\n <td class=\"text\">${esc(formatInputValue(c.input).slice(0, 120))}</td>\n <td class=\"text\">${esc(c.output.slice(0, 120))}</td>\n ${scoresCells}\n <td>${c.latencyMs}ms</td>\n <td class=\"error-text\">${c.error ? esc(formatErrorValue(c.error)) : ''}</td>\n </tr>`;\n })\n .join('\\n');\n\n const scorerHeaders = scorerNames.map((n) => `<th>${esc(n)}</th>`).join('');\n const meanScoreRows = Object.entries(summary.meanScores)\n .map(\n ([name, score]) =>\n `<tr><td>${esc(name)}</td><td>${score.toFixed(3)}</td></tr>`,\n )\n .join('');\n\n return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>${esc(data.name)} \u2014 Eval Report</title>\n<style>\n * { box-sizing: border-box; margin: 0; padding: 0; }\n body { font-family: system-ui, -apple-system, sans-serif; background: #f8f9fa; color: #1a1a1a; padding: 2rem; }\n h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }\n .meta { color: #666; margin-bottom: 1.5rem; font-size: 0.9rem; }\n .meta span { margin-right: 1.5rem; }\n .summary-table, .cases-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }\n .summary-table th, .summary-table td,\n .cases-table th, .cases-table td { padding: 0.5rem 0.75rem; border: 1px solid #ddd; text-align: left; font-size: 0.85rem; }\n .summary-table th, .cases-table th { background: #f1f3f5; font-weight: 600; }\n .cases-table .text { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .cases-table .error-text { max-width: 480px; white-space: pre-wrap; word-break: break-word; }\n .pass { color: #2b8a3e; }\n .fail { color: #c92a2a; }\n .error { color: #e67700; }\n tr.pass:hover, tr.fail:hover, tr.error:hover { background: #f1f3f5; }\n td.pass { background: #ebfbee; }\n td.fail { background: #fff5f5; }\n h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }\n</style>\n</head>\n<body>\n <h1>${esc(data.name)}</h1>\n <div class=\"meta\">\n <span><strong>Model:</strong> ${esc(data.model)}</span>\n <span><strong>Cases:</strong> ${summary.totalCases}</span>\n <span><strong>Pass:</strong> ${summary.passCount}</span>\n <span><strong>Fail:</strong> ${summary.failCount}</span>\n <span><strong>Duration:</strong> ${formatDuration(summary.totalLatencyMs)}</span>\n <span><strong>Tokens:</strong> ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}</span>\n </div>\n\n <h2>Mean Scores</h2>\n <table class=\"summary-table\">\n <thead><tr><th>Scorer</th><th>Mean</th></tr></thead>\n <tbody>${meanScoreRows}</tbody>\n </table>\n\n <h2>Cases</h2>\n <table class=\"cases-table\">\n <thead>\n <tr>\n <th>#</th>\n <th>Status</th>\n <th>Input</th>\n <th>Output</th>\n ${scorerHeaders}\n <th>Latency</th>\n <th>Error</th>\n </tr>\n </thead>\n <tbody>\n ${caseRows}\n </tbody>\n </table>\n</body>\n</html>`;\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,OAAO,WAAW;;;ACKX,SAAS,eAAe,IAAoB;AACjD,MAAI,KAAK,IAAM,QAAO,GAAG,EAAE;AAC3B,SAAO,IAAI,KAAK,KAAM,QAAQ,CAAC,CAAC;AAClC;AAEO,SAAS,aAAa,GAAmB;AAC9C,MAAI,KAAK,IAAW,QAAO,IAAI,IAAI,KAAW,QAAQ,CAAC,CAAC;AACxD,MAAI,KAAK,IAAO,QAAO,IAAI,IAAI,KAAO,QAAQ,CAAC,CAAC;AAChD,SAAO,OAAO,CAAC;AACjB;AAEO,SAAS,iBACd,MACA,OACA,KACQ;AACR,QAAM,OAAO,KAAK,QAAQ,mBAAmB,GAAG,EAAE,YAAY;AAC9D,QAAM,SAAS,MAAM,MAAM,GAAG,CAAC;AAC/B,SAAO,GAAG,IAAI,IAAI,MAAM,IAAI,GAAG;AACjC;AAEO,SAAS,iBACd,OACA,SAIQ;AACR,MAAI,OAAO,UAAU,SAAU,QAAO;AAEtC,QAAM,QAAQ,SAAS,SAAS;AAChC,QAAM,WAAW,SAAS,YAAY;AACtC,MAAI;AACF,WAAO,KAAK,UAAU,OAAO,MAAM,KAAK,KAAK;AAAA,EAC/C,QAAQ;AACN,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;AAEO,SAAS,iBAAiB,OAAwB;AACvD,SAAO,iBAAiB,OAAO,EAAE,OAAO,GAAG,UAAU,GAAG,CAAC;AAC3D;AAEO,SAAS,iBAAiB,OAAwB;AACvD,MAAI,SAAS,KAAM,QAAO;AAC1B,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,SAAO,iBAAiB,OAAO,EAAE,OAAO,GAAG,UAAU,GAAG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Q,EAAE,QAAQ,IAAI,iBAAiB,EAAE,KAAK,CAAC,IAAI,EAAE;AAAA;AAAA,EAE1E,CAAC,EACA,KAAK,IAAI;AAEZ,QAAM,gBAAgB,YAAY,IAAI,CAAC,MAAM,OAAO,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE;AAC1E,QAAM,gBAAgB,OAAO,QAAQ,QAAQ,UAAU,EACpD;AAAA,IACC,CAAC,CAAC,MAAM,KAAK,MACX,WAAW,IAAI,IAAI,CAAC,YAAY,MAAM,QAAQ,CAAC,CAAC;AAAA,EACpD,EACC,KAAK,EAAE;AAEV,SAAO;AAAA;AAAA;AAAA;AAAA,SAIA,IAAI,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAuBf,IAAI,KAAK,IAAI,CAAC;AAAA;AAAA,oCAEc,IAAI,KAAK,KAAK,CAAC;AAAA,oCACf,QAAQ,UAAU;AAAA,mCACnB,QAAQ,SAAS;AAAA,mCACjB,QAAQ,SAAS;AAAA,uCACb,eAAe,QAAQ,cAAc,CAAC;AAAA,qCACxC,aAAa,QAAQ,gBAAgB,QAAQ,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAMpF,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAWhB,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMf,QAAQ;AAAA;AAAA;AAAA;AAAA;AAKhB;",
|
|
6
|
-
"names": ["mkdir", "mkdir"]
|
|
4
|
+
"sourcesContent": ["import chalk from 'chalk';\n\nimport {\n formatDuration,\n formatErrorValue,\n formatTokens,\n stringifyUnknown,\n} from './format.ts';\nimport { getCaseStatus } from './shared.ts';\nimport type { CaseResult, Reporter, RunEndData, Verbosity } from './types.ts';\n\nexport interface ConsoleReporterOptions {\n verbosity?: Verbosity;\n}\n\nconst BAR_WIDTH = 20;\n\nfunction renderProgressBar(\n completed: number,\n total: number,\n elapsedMs: number,\n): string {\n const pct = total > 0 ? completed / total : 0;\n const filled = Math.round(pct * BAR_WIDTH);\n const bar = '\\u2593'.repeat(filled) + '\\u2591'.repeat(BAR_WIDTH - filled);\n const pctStr = `${(pct * 100).toFixed(0)}%`;\n return ` ${bar} ${pctStr} (${completed}/${total}) ${formatDuration(elapsedMs)}`;\n}\n\nfunction statusLabel(status: 'pass' | 'fail' | 'error'): string {\n if (status === 'pass') return chalk.green('PASS');\n if (status === 'error') return chalk.yellow('ERROR');\n return chalk.red('FAIL');\n}\n\nexport function consoleReporter(options?: ConsoleReporterOptions): Reporter {\n const verbosity = options?.verbosity ?? 'normal';\n\n let totalCases = 0;\n let completed = 0;\n let startTime = 0;\n\n return {\n onRunStart(data) {\n totalCases = data.totalCases;\n completed = 0;\n startTime = Date.now();\n\n if (verbosity !== 'quiet') {\n const label = data.name;\n console.log('');\n console.log(\n ` ${chalk.dim('\\u2500\\u2500')} ${chalk.bold(label)} ${chalk.dim('\\u2500'.repeat(Math.max(0, 56 - label.length)))}`,\n );\n console.log(` ${chalk.dim(`Running ${data.totalCases} cases...`)}`);\n console.log('');\n }\n },\n\n onCaseEnd() {\n completed++;\n if (verbosity !== 'quiet') {\n const elapsed = Date.now() - startTime;\n process.stdout.write(\n `\\r${renderProgressBar(completed, totalCases, elapsed)}`,\n );\n }\n },\n\n onRunEnd(data) {\n if (verbosity !== 'quiet') {\n process.stdout.write('\\r' + ' '.repeat(70) + '\\r');\n }\n\n renderSummaryTable(data);\n\n if (verbosity === 'quiet') return;\n\n const sorted = [...data.cases].sort((a, b) => a.index - b.index);\n\n if (verbosity === 'verbose') {\n for (const c of sorted) {\n renderCaseDetail(c, data.threshold, {\n includeIO: true,\n maxStringLength: 20_000,\n });\n }\n } else {\n renderFailuresByScorer(sorted, data.threshold);\n }\n },\n };\n}\n\nfunction indentBlock(text: string, spaces: number): string {\n const pad = ' '.repeat(spaces);\n return text\n .replace(/\\r\\n/g, '\\n')\n .split('\\n')\n .map((line) => pad + line)\n .join('\\n');\n}\n\nfunction truncateString(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return text.slice(0, maxLength) + '\\u2026';\n}\n\nfunction stringifyRationale(value: unknown): string | undefined {\n if (typeof value === 'string') {\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n }\n\n if (Array.isArray(value)) {\n const parts = value\n .map((item) => (typeof item === 'string' ? item.trim() : ''))\n .filter(Boolean);\n if (parts.length > 0) return parts.join(' | ');\n }\n\n return undefined;\n}\n\nfunction scoreReasonWithMetadata(score: {\n reason?: string;\n metadata?: Record<string, unknown>;\n}): string | undefined {\n const reason = score.reason?.trim();\n if (reason) return reason;\n return stringifyRationale(score.metadata?.['rationale']);\n}\n\nfunction renderSummaryTable(data: RunEndData): void {\n const { summary } = data;\n const passRate =\n summary.totalCases > 0\n ? ((summary.passCount / summary.totalCases) * 100).toFixed(1)\n : '0.0';\n\n console.log('');\n console.log(chalk.bold(' Summary'));\n console.log(chalk.dim(' ' + '\\u2500'.repeat(60)));\n console.log(` ${chalk.dim('Eval:')} ${data.name}`);\n console.log(` ${chalk.dim('Model:')} ${data.model}`);\n console.log(` ${chalk.dim('Threshold:')} ${data.threshold}`);\n console.log(` ${chalk.dim('Cases:')} ${summary.totalCases}`);\n console.log(\n ` ${chalk.dim('Pass/Fail:')} ${chalk.green(String(summary.passCount))} / ${chalk.red(String(summary.failCount))} ${chalk.dim(`(${passRate}%)`)}`,\n );\n console.log(\n ` ${chalk.dim('Duration:')} ${formatDuration(summary.totalLatencyMs)}`,\n );\n console.log(\n ` ${chalk.dim('Tokens:')} ${chalk.dim('In:')} ${formatTokens(summary.totalTokensIn)} ${chalk.dim('Out:')} ${formatTokens(summary.totalTokensOut)} ${chalk.dim('Total:')} ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}`,\n );\n\n const scoreEntries = Object.entries(summary.meanScores);\n if (scoreEntries.length > 0) {\n console.log('');\n console.log(chalk.bold(' Scores'));\n for (const [name, score] of scoreEntries) {\n const scoreColor = score >= data.threshold ? chalk.green : chalk.red;\n console.log(\n ` ${chalk.dim(name + ':')}${' '.repeat(Math.max(1, 12 - name.length))}${scoreColor(score.toFixed(3))}`,\n );\n }\n }\n\n console.log(chalk.dim(' ' + '\\u2500'.repeat(60)));\n console.log('');\n}\n\nfunction renderCaseDetail(\n c: CaseResult,\n threshold: number,\n options?: {\n includeIO?: boolean;\n maxStringLength?: number;\n },\n): void {\n const entries = Object.entries(c.scores);\n const status = getCaseStatus(c, threshold);\n const prefix = statusLabel(status);\n const includeIO = options?.includeIO ?? false;\n const maxStringLength = options?.maxStringLength ?? 4_000;\n\n const meta = `${chalk.dim(formatDuration(c.latencyMs))} ${chalk.dim(`${c.tokensIn}/${c.tokensOut} tokens`)}`;\n console.log(` ${prefix} ${chalk.dim(`Case #${c.index}`)} ${meta}`);\n\n const inputStr = stringifyUnknown(c.input, {\n space: 2,\n fallback: String(c.input),\n });\n console.log(` ${chalk.dim('Input:')}`);\n console.log(indentBlock(truncateString(inputStr, maxStringLength), 6));\n\n if (includeIO) {\n console.log(` ${chalk.dim('Output:')}`);\n console.log(indentBlock(truncateString(c.output, maxStringLength), 6));\n console.log(` ${chalk.dim('Expected:')}`);\n const expectedStrRaw = stringifyUnknown(c.expected, {\n space: 2,\n fallback: String(c.expected),\n });\n console.log(\n indentBlock(truncateString(expectedStrRaw, maxStringLength), 6),\n );\n }\n\n for (const [name, s] of entries) {\n const scoreColor = s.score >= threshold ? chalk.green : chalk.red;\n const reason = scoreReasonWithMetadata(s);\n const reasonStr = reason ? ` \\u2014 ${reason}` : '';\n console.log(\n ` ${chalk.dim(name + ':')} ${scoreColor(s.score.toFixed(3))}${reasonStr}`,\n );\n }\n\n if (c.error) {\n console.log(` ${chalk.dim('Error:')}`);\n const errorStr = formatErrorValue(c.error);\n console.log(` ${chalk.red(errorStr)}`);\n }\n\n console.log('');\n}\n\nfunction renderFailuresByScorer(cases: CaseResult[], threshold: number): void {\n const scorerNames = new Set<string>();\n for (const c of cases) {\n for (const name of Object.keys(c.scores)) {\n scorerNames.add(name);\n }\n }\n\n let hasFailures = false;\n\n for (const scorer of scorerNames) {\n const failing = cases.filter((c) => {\n const s = c.scores[scorer];\n return (\n (s && s.score < threshold) || getCaseStatus(c, threshold) === 'error'\n );\n });\n\n if (failing.length === 0) continue;\n\n if (!hasFailures) {\n console.log(chalk.dim(' Failing by scorer:'));\n console.log('');\n hasFailures = true;\n }\n\n console.log(\n ` ${chalk.bold(scorer)} ${chalk.dim(`(${failing.length} failures)`)}`,\n );\n console.log(chalk.dim(' ' + '\\u2500'.repeat(40)));\n\n for (const c of failing) {\n renderCaseDetail(c, threshold, {\n includeIO: true,\n maxStringLength: 4_000,\n });\n }\n }\n}\n", "export function truncate(str: string, maxLen = 80): string {\n if (str.length <= maxLen) return str;\n return str.slice(0, maxLen) + '...';\n}\n\nexport function formatDuration(ms: number): string {\n if (ms < 1000) return `${ms}ms`;\n return `${(ms / 1000).toFixed(1)}s`;\n}\n\nexport function formatTokens(n: number): string {\n if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;\n if (n >= 1_000) return `${(n / 1_000).toFixed(0)}k`;\n return String(n);\n}\n\nexport function generateFilename(\n name: string,\n runId: string,\n ext: string,\n): string {\n const slug = name.replace(/[^a-zA-Z0-9-_]/g, '-').toLowerCase();\n const prefix = runId.slice(0, 8);\n return `${slug}-${prefix}.${ext}`;\n}\n\nexport function stringifyUnknown(\n value: unknown,\n options?: {\n space?: number;\n fallback?: string;\n },\n): string {\n if (typeof value === 'string') return value;\n\n const space = options?.space ?? 0;\n const fallback = options?.fallback ?? 'null';\n try {\n return JSON.stringify(value, null, space) ?? fallback;\n } catch {\n return String(value);\n }\n}\n\nexport function formatInputValue(value: unknown): string {\n return stringifyUnknown(value, { space: 0, fallback: '' });\n}\n\nexport function formatErrorValue(value: unknown): string {\n if (value == null) return '';\n if (typeof value === 'string') return value;\n return stringifyUnknown(value, { space: 2, fallback: '' });\n}\n\nexport function escapeCsv(value: unknown): string {\n const str = stringifyUnknown(value, { space: 0, fallback: 'null' });\n if (str.includes(',') || str.includes('\"') || str.includes('\\n')) {\n return `\"${str.replace(/\"/g, '\"\"')}\"`;\n }\n return str;\n}\n", "import { mkdir, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport { generateFilename } from './format.ts';\nimport type { CaseResult, Reporter, RunEndData } from './types.ts';\n\nconst DEFAULT_OUTPUT_DIR = '.evals/reports';\n\nexport function resolveOutputDir(outputDir?: string): string {\n return outputDir ?? DEFAULT_OUTPUT_DIR;\n}\n\nexport function getReportPath(\n outputDir: string,\n name: string,\n runId: string,\n ext: string,\n): string {\n return join(outputDir, generateFilename(name, runId, ext));\n}\n\nexport async function writeRunReportFile(\n outputDir: string,\n name: string,\n runId: string,\n ext: string,\n content: string,\n): Promise<void> {\n await mkdir(outputDir, { recursive: true });\n await writeFile(getReportPath(outputDir, name, runId, ext), content, 'utf-8');\n}\n\nexport function getCaseStatus(\n result: CaseResult,\n threshold: number,\n): 'error' | 'pass' | 'fail' {\n if (result.error) return 'error';\n const passed = Object.values(result.scores).every(\n (s) => s.score >= threshold,\n );\n return passed ? 'pass' : 'fail';\n}\n\nexport function createRunEndFileReporter(options: {\n outputDir?: string;\n ext: string;\n render: (data: RunEndData) => string | Promise<string>;\n}): Reporter {\n const outputDir = resolveOutputDir(options.outputDir);\n\n return {\n async onRunEnd(data) {\n const content = await options.render(data);\n await writeRunReportFile(\n outputDir,\n data.name,\n data.runId,\n options.ext,\n content,\n );\n },\n };\n}\n", "import { appendFile, mkdir } from 'node:fs/promises';\n\nimport { stringifyUnknown } from './format.ts';\nimport {\n getReportPath,\n resolveOutputDir,\n writeRunReportFile,\n} from './shared.ts';\nimport type { Reporter } from './types.ts';\n\nexport interface JsonReporterOptions {\n outputDir?: string;\n pretty?: boolean;\n}\n\nexport function jsonReporter(options?: JsonReporterOptions): Reporter {\n const outputDir = resolveOutputDir(options?.outputDir);\n const pretty = options?.pretty ?? true;\n let streamFilename = '';\n\n return {\n async onRunStart(data) {\n await mkdir(outputDir, { recursive: true });\n streamFilename = getReportPath(outputDir, data.name, data.runId, 'jsonl');\n },\n async onCaseEnd(data) {\n const line = stringifyUnknown(data, { space: 0, fallback: 'null' });\n await appendFile(streamFilename, line + '\\n', 'utf-8');\n },\n async onRunEnd(data) {\n const content = stringifyUnknown(data, {\n space: pretty ? 2 : 0,\n fallback: 'null',\n });\n await writeRunReportFile(\n outputDir,\n data.name,\n data.runId,\n 'json',\n content,\n );\n },\n };\n}\n", "import { escapeCsv } from './format.ts';\nimport { createRunEndFileReporter, getCaseStatus } from './shared.ts';\nimport type { Reporter } from './types.ts';\n\nexport interface CsvReporterOptions {\n outputDir?: string;\n}\n\nexport function csvReporter(options?: CsvReporterOptions): Reporter {\n return createRunEndFileReporter({\n outputDir: options?.outputDir,\n ext: 'csv',\n render(data) {\n const scorerNames = Object.keys(data.summary.meanScores);\n\n const headerParts = [\n 'index',\n 'status',\n 'input',\n 'output',\n 'expected',\n 'error',\n 'latency_ms',\n 'tokens_in',\n 'tokens_out',\n ];\n for (const name of scorerNames) {\n headerParts.push(`${name}_score`, `${name}_reason`);\n }\n\n const rows = [headerParts.join(',')];\n\n for (const c of data.cases) {\n const status = getCaseStatus(c, data.threshold);\n const parts = [\n String(c.index),\n status,\n escapeCsv(c.input),\n escapeCsv(c.output),\n escapeCsv(c.expected),\n escapeCsv(c.error ?? ''),\n String(c.latencyMs),\n String(c.tokensIn),\n String(c.tokensOut),\n ];\n for (const name of scorerNames) {\n const s = c.scores[name];\n parts.push(String(s?.score ?? ''), escapeCsv(s?.reason ?? ''));\n }\n rows.push(parts.join(','));\n }\n\n return rows.join('\\n') + '\\n';\n },\n });\n}\n", "import {\n formatDuration,\n formatErrorValue,\n formatInputValue,\n formatTokens,\n} from './format.ts';\nimport { createRunEndFileReporter, getCaseStatus } from './shared.ts';\nimport type { Reporter } from './types.ts';\n\nexport interface MarkdownReporterOptions {\n outputDir?: string;\n}\n\nexport function markdownReporter(options?: MarkdownReporterOptions): Reporter {\n return createRunEndFileReporter({\n outputDir: options?.outputDir,\n ext: 'md',\n render(data) {\n const { summary } = data;\n const scorerNames = Object.keys(summary.meanScores);\n const lines: string[] = [];\n const passRate =\n summary.totalCases > 0\n ? ((summary.passCount / summary.totalCases) * 100).toFixed(1)\n : '0.0';\n\n lines.push(`# ${data.name}`);\n lines.push('');\n lines.push(`**Model:** ${data.model}`);\n lines.push(`**Threshold:** ${data.threshold}`);\n lines.push(\n `**Cases:** ${summary.totalCases} (${summary.passCount} pass, ${summary.failCount} fail, ${passRate}%)`,\n );\n lines.push(`**Duration:** ${formatDuration(summary.totalLatencyMs)}`);\n lines.push(\n `**Tokens:** In: ${formatTokens(summary.totalTokensIn)} | Out: ${formatTokens(summary.totalTokensOut)} | Total: ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}`,\n );\n lines.push('');\n\n lines.push('## Scores');\n lines.push('');\n lines.push('| Scorer | Mean |');\n lines.push('|--------|------|');\n for (const [name, score] of Object.entries(summary.meanScores)) {\n lines.push(`| ${name} | ${score.toFixed(3)} |`);\n }\n lines.push('');\n\n lines.push('## Cases');\n lines.push('');\n\n const caseHeader = [\n '#',\n 'Status',\n 'Input',\n ...scorerNames,\n 'Latency',\n 'Tokens',\n 'Error',\n ];\n lines.push(`| ${caseHeader.join(' | ')} |`);\n lines.push(`| ${caseHeader.map(() => '---').join(' | ')} |`);\n\n for (const c of data.cases) {\n const statusValue = getCaseStatus(c, data.threshold);\n const status =\n statusValue === 'error'\n ? '\uD83D\uDD34 Error'\n : statusValue === 'pass'\n ? '\u2705 Pass'\n : '\u274C Fail';\n const input = formatInputValue(c.input).slice(0, 60);\n const scores = scorerNames.map(\n (name) => c.scores[name]?.score.toFixed(3) ?? '-',\n );\n const error = c.error\n ? formatErrorValue(c.error)\n .replace(/\\r?\\n/g, '<br>')\n .replace(/\\|/g, '\\\\|')\n : '-';\n const row = [\n String(c.index),\n status,\n input,\n ...scores,\n formatDuration(c.latencyMs),\n `${c.tokensIn}/${c.tokensOut}`,\n error,\n ];\n lines.push(`| ${row.join(' | ')} |`);\n }\n lines.push('');\n\n return lines.join('\\n');\n },\n });\n}\n", "import {\n formatDuration,\n formatErrorValue,\n formatInputValue,\n formatTokens,\n stringifyUnknown,\n} from './format.ts';\nimport { createRunEndFileReporter, getCaseStatus } from './shared.ts';\nimport type { Reporter, RunEndData } from './types.ts';\n\nexport interface HtmlReporterOptions {\n outputDir?: string;\n}\n\nexport function htmlReporter(options?: HtmlReporterOptions): Reporter {\n return createRunEndFileReporter({\n outputDir: options?.outputDir,\n ext: 'html',\n render: renderHtml,\n });\n}\n\nfunction esc(str: string): string {\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"');\n}\n\nfunction renderHtml(data: RunEndData): string {\n const { summary } = data;\n const scorerNames = Object.keys(summary.meanScores);\n const passRate =\n summary.totalCases > 0\n ? ((summary.passCount / summary.totalCases) * 100).toFixed(1)\n : '0.0';\n\n const caseRows = data.cases\n .map((c) => {\n const status = getCaseStatus(c, data.threshold);\n const statusLabel =\n status === 'error' ? 'ERROR' : status === 'pass' ? 'PASS' : 'FAIL';\n const scoresCells = scorerNames\n .map((name) => {\n const s = c.scores[name];\n const score = s?.score ?? 0;\n const cls = score >= data.threshold ? 'pass' : 'fail';\n const reason = s?.reason ? ` title=\"${esc(s.reason)}\"` : '';\n return `<td class=\"${cls}\"${reason}>${score.toFixed(3)}</td>`;\n })\n .join('');\n\n const expectedStr = stringifyUnknown(c.expected, {\n space: 0,\n fallback: '',\n });\n\n return `<tr class=\"${status}\">\n <td>${c.index}</td>\n <td class=\"${status}\">${statusLabel}</td>\n <td class=\"text\">${esc(formatInputValue(c.input).slice(0, 120))}</td>\n <td class=\"text\">${esc(c.output.slice(0, 120))}</td>\n <td class=\"text\">${esc(expectedStr.slice(0, 120))}</td>\n ${scoresCells}\n <td>${formatDuration(c.latencyMs)}</td>\n <td>${c.tokensIn}/${c.tokensOut}</td>\n <td class=\"error-text\">${c.error ? esc(formatErrorValue(c.error)) : ''}</td>\n </tr>`;\n })\n .join('\\n');\n\n const scorerHeaders = scorerNames.map((n) => `<th>${esc(n)}</th>`).join('');\n const meanScoreRows = Object.entries(summary.meanScores)\n .map(\n ([name, score]) =>\n `<tr><td>${esc(name)}</td><td>${score.toFixed(3)}</td></tr>`,\n )\n .join('');\n\n return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>${esc(data.name)} \u2014 Eval Report</title>\n<style>\n * { box-sizing: border-box; margin: 0; padding: 0; }\n body { font-family: system-ui, -apple-system, sans-serif; background: #f8f9fa; color: #1a1a1a; padding: 2rem; }\n h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }\n .meta { color: #666; margin-bottom: 1.5rem; font-size: 0.9rem; }\n .meta span { margin-right: 1.5rem; }\n .summary-table, .cases-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }\n .summary-table th, .summary-table td,\n .cases-table th, .cases-table td { padding: 0.5rem 0.75rem; border: 1px solid #ddd; text-align: left; font-size: 0.85rem; }\n .summary-table th, .cases-table th { background: #f1f3f5; font-weight: 600; }\n .cases-table .text { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .cases-table .error-text { max-width: 480px; white-space: pre-wrap; word-break: break-word; }\n .pass { color: #2b8a3e; }\n .fail { color: #c92a2a; }\n .error { color: #e67700; }\n tr.pass:hover, tr.fail:hover, tr.error:hover { background: #f1f3f5; }\n td.pass { background: #ebfbee; }\n td.fail { background: #fff5f5; }\n h2 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }\n</style>\n</head>\n<body>\n <h1>${esc(data.name)}</h1>\n <div class=\"meta\">\n <span><strong>Model:</strong> ${esc(data.model)}</span>\n <span><strong>Threshold:</strong> ${data.threshold}</span>\n <span><strong>Cases:</strong> ${summary.totalCases}</span>\n <span><strong>Pass:</strong> ${summary.passCount}</span>\n <span><strong>Fail:</strong> ${summary.failCount} (${passRate}%)</span>\n <span><strong>Duration:</strong> ${formatDuration(summary.totalLatencyMs)}</span>\n <span><strong>Tokens In:</strong> ${formatTokens(summary.totalTokensIn)}</span>\n <span><strong>Tokens Out:</strong> ${formatTokens(summary.totalTokensOut)}</span>\n <span><strong>Total Tokens:</strong> ${formatTokens(summary.totalTokensIn + summary.totalTokensOut)}</span>\n </div>\n\n <h2>Mean Scores</h2>\n <table class=\"summary-table\">\n <thead><tr><th>Scorer</th><th>Mean</th></tr></thead>\n <tbody>${meanScoreRows}</tbody>\n </table>\n\n <h2>Cases</h2>\n <table class=\"cases-table\">\n <thead>\n <tr>\n <th>#</th>\n <th>Status</th>\n <th>Input</th>\n <th>Output</th>\n <th>Expected</th>\n ${scorerHeaders}\n <th>Latency</th>\n <th>Tokens</th>\n <th>Error</th>\n </tr>\n </thead>\n <tbody>\n ${caseRows}\n </tbody>\n </table>\n</body>\n</html>`;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,WAAW;;;ACKX,SAAS,eAAe,IAAoB;AACjD,MAAI,KAAK,IAAM,QAAO,GAAG,EAAE;AAC3B,SAAO,IAAI,KAAK,KAAM,QAAQ,CAAC,CAAC;AAClC;AAEO,SAAS,aAAa,GAAmB;AAC9C,MAAI,KAAK,IAAW,QAAO,IAAI,IAAI,KAAW,QAAQ,CAAC,CAAC;AACxD,MAAI,KAAK,IAAO,QAAO,IAAI,IAAI,KAAO,QAAQ,CAAC,CAAC;AAChD,SAAO,OAAO,CAAC;AACjB;AAEO,SAAS,iBACd,MACA,OACA,KACQ;AACR,QAAM,OAAO,KAAK,QAAQ,mBAAmB,GAAG,EAAE,YAAY;AAC9D,QAAM,SAAS,MAAM,MAAM,GAAG,CAAC;AAC/B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AA;AAAA;AAAA,UAYhB,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAOf,QAAQ;AAAA;AAAA;AAAA;AAAA;AAKhB;",
|
|
6
|
+
"names": ["mkdir", "mkdir", "statusLabel"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/reporters/markdown.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/reporters/markdown.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,QAAQ,CAmF5E"}
|
package/dist/scorers/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { LanguageModelV3 } from '@ai-sdk/provider';
|
|
2
1
|
export interface ScorerArgs {
|
|
3
2
|
input: unknown;
|
|
4
3
|
output: string;
|
|
@@ -7,6 +6,7 @@ export interface ScorerArgs {
|
|
|
7
6
|
export interface ScorerResult {
|
|
8
7
|
score: number;
|
|
9
8
|
reason?: string;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
10
|
}
|
|
11
11
|
export type Scorer = (args: ScorerArgs) => Promise<ScorerResult>;
|
|
12
12
|
export declare const exactMatch: Scorer;
|
|
@@ -14,12 +14,8 @@ export declare const includes: Scorer;
|
|
|
14
14
|
export declare function regex(pattern: RegExp): Scorer;
|
|
15
15
|
export declare const levenshtein: Scorer;
|
|
16
16
|
export declare const jsonMatch: Scorer;
|
|
17
|
-
export declare function llmJudge(config: {
|
|
18
|
-
model: LanguageModelV3;
|
|
19
|
-
criteria: string;
|
|
20
|
-
}): Scorer;
|
|
21
17
|
export declare function factuality(config: {
|
|
22
|
-
model:
|
|
18
|
+
model: string;
|
|
23
19
|
}): Scorer;
|
|
24
20
|
export declare function all(...scorers: Scorer[]): Scorer;
|
|
25
21
|
export declare function any(...scorers: Scorer[]): Scorer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scorers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scorers/index.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAEjE,eAAO,MAAM,UAAU,EAAE,MAOxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAOtB,CAAC;AAEF,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI7C;AAwBD,eAAO,MAAM,WAAW,EAAE,MASzB,CAAC;AA6BF,eAAO,MAAM,SAAS,EAAE,MAUvB,CAAC;AAEF,wBAAgB,UAAU,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAc5D;AAED,wBAAgB,GAAG,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAahD;AAED,wBAAgB,GAAG,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAShD;AAED,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GACzD,MAAM,CAqBR"}
|