@m4trix/evals 0.14.0 → 0.15.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/dist/cli.cjs CHANGED
@@ -2311,26 +2311,60 @@ function buildDetailRows(run, testCases, evaluatorNameById) {
2311
2311
  ":",
2312
2312
  " ",
2313
2313
  /* @__PURE__ */ jsxRuntime.jsx(ink.Text, { color: item.passed ? "green" : "red", bold: true, children: item.passed ? "PASS" : "FAIL" }),
2314
- " ",
2315
- item.scores.map((s) => /* @__PURE__ */ jsxRuntime.jsxs(ink.Text, { color: scoreColor(toNumericScore(s.data) ?? 0), children: [
2316
- formatScorePart(s),
2317
- " "
2318
- ] }, s.id)),
2319
- item.metrics?.map((m) => {
2320
- const def = getMetricById(m.id);
2321
- if (!def)
2322
- return null;
2323
- const formatted = def.format(m.data);
2324
- return /* @__PURE__ */ jsxRuntime.jsxs(ink.Text, { color: "gray", children: [
2325
- "[",
2326
- def.name ? `${def.name}: ` : "",
2327
- formatted,
2328
- "]",
2329
- " "
2330
- ] }, m.id);
2331
- })
2314
+ item.metrics && item.metrics.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2315
+ " ",
2316
+ item.metrics.map((m) => {
2317
+ const def = getMetricById(m.id);
2318
+ if (!def)
2319
+ return null;
2320
+ const formatted = def.format(m.data);
2321
+ return /* @__PURE__ */ jsxRuntime.jsxs(ink.Text, { color: "gray", children: [
2322
+ "[",
2323
+ def.name ? `${def.name}: ` : "",
2324
+ formatted,
2325
+ "]",
2326
+ " "
2327
+ ] }, m.id);
2328
+ })
2329
+ ] }) : null
2332
2330
  ] }, `tc-${tc.testCaseId}-${item.evaluatorId}`)
2333
2331
  );
2332
+ if (item.scores.length > 0) {
2333
+ for (let sIdx = 0; sIdx < item.scores.length; sIdx++) {
2334
+ const s = item.scores[sIdx];
2335
+ const def = getScoreById(s.id);
2336
+ const scoreLabel = def ? def.name ?? def.id : s.id;
2337
+ rows.push(
2338
+ /* @__PURE__ */ jsxRuntime.jsxs(
2339
+ ink.Text,
2340
+ {
2341
+ color: scoreColor(toNumericScore(s.data) ?? 0),
2342
+ children: [
2343
+ " ",
2344
+ scoreLabel,
2345
+ ": ",
2346
+ formatScorePart(s)
2347
+ ]
2348
+ },
2349
+ `tc-${tc.testCaseId}-${item.evaluatorId}-score-${sIdx}`
2350
+ )
2351
+ );
2352
+ }
2353
+ } else {
2354
+ rows.push(
2355
+ /* @__PURE__ */ jsxRuntime.jsxs(
2356
+ ink.Text,
2357
+ {
2358
+ color: "gray",
2359
+ children: [
2360
+ " ",
2361
+ "n/a"
2362
+ ]
2363
+ },
2364
+ `tc-${tc.testCaseId}-${item.evaluatorId}-n/a`
2365
+ )
2366
+ );
2367
+ }
2334
2368
  if (!item.passed && item.logs && item.logs.length > 0) {
2335
2369
  for (let logIdx = 0; logIdx < item.logs.length; logIdx++) {
2336
2370
  const log = item.logs[logIdx];