braintrust 3.24.0 → 3.25.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/dev/dist/index.d.mts +5 -0
- package/dev/dist/index.d.ts +5 -0
- package/dev/dist/index.js +2614 -1567
- package/dev/dist/index.mjs +2037 -990
- package/dist/apply-auto-instrumentation.js +200 -199
- package/dist/apply-auto-instrumentation.mjs +8 -7
- package/dist/auto-instrumentations/bundler/esbuild.cjs +596 -462
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
- package/dist/auto-instrumentations/bundler/next.cjs +596 -462
- package/dist/auto-instrumentations/bundler/next.mjs +3 -3
- package/dist/auto-instrumentations/bundler/rollup.cjs +596 -462
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +596 -462
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +596 -462
- package/dist/auto-instrumentations/bundler/webpack.cjs +596 -462
- package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
- package/dist/auto-instrumentations/{chunk-BURMPO7L.mjs → chunk-7P6563SW.mjs} +1 -1
- package/dist/auto-instrumentations/{chunk-F43DNLPD.mjs → chunk-CZ24KNHT.mjs} +569 -442
- package/dist/auto-instrumentations/{chunk-GSZHTAQW.mjs → chunk-JPVCUKTY.mjs} +30 -21
- package/dist/auto-instrumentations/hook.mjs +648 -476
- package/dist/auto-instrumentations/index.cjs +568 -442
- package/dist/auto-instrumentations/index.mjs +1 -1
- package/dist/browser.d.mts +7 -0
- package/dist/browser.d.ts +7 -0
- package/dist/browser.js +2022 -971
- package/dist/browser.mjs +2022 -971
- package/dist/{chunk-XE5FS7QY.mjs → chunk-2SANLSWX.mjs} +1375 -597
- package/dist/{chunk-7F6GCRHH.mjs → chunk-ABR2QWDP.mjs} +702 -456
- package/dist/{chunk-SU6EHKJV.js → chunk-GSIDVFE6.js} +2176 -1398
- package/dist/{chunk-7AUY2XWX.js → chunk-P25IOOU4.js} +704 -458
- package/dist/cli.js +2005 -958
- package/dist/edge-light.js +2022 -971
- package/dist/edge-light.mjs +2022 -971
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +447 -402
- package/dist/index.mjs +72 -27
- package/dist/instrumentation/index.d.mts +5 -0
- package/dist/instrumentation/index.d.ts +5 -0
- package/dist/instrumentation/index.js +1990 -981
- package/dist/instrumentation/index.mjs +1990 -981
- package/dist/vitest-evals-reporter.js +16 -16
- package/dist/vitest-evals-reporter.mjs +2 -2
- package/dist/workerd.js +2022 -971
- package/dist/workerd.mjs +2022 -971
- package/package.json +2 -2
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkGSIDVFE6js = require('./chunk-GSIDVFE6.js');
|
|
8
|
+
require('./chunk-P25IOOU4.js');
|
|
9
9
|
|
|
10
10
|
// src/wrappers/vitest-evals/reporter.ts
|
|
11
|
-
|
|
11
|
+
_chunkGSIDVFE6js.configureNode.call(void 0, );
|
|
12
12
|
var RESERVED_NORMALIZED_SPAN_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
13
13
|
"name",
|
|
14
14
|
"type",
|
|
@@ -43,7 +43,7 @@ var BraintrustVitestEvalsReporter = class {
|
|
|
43
43
|
for (const { test, meta } of evalTests) {
|
|
44
44
|
logEvalTest(experiment, test, meta);
|
|
45
45
|
}
|
|
46
|
-
await
|
|
46
|
+
await _chunkGSIDVFE6js.summarizeAndFlush.call(void 0, experiment, {
|
|
47
47
|
displaySummary: this.options.displaySummary
|
|
48
48
|
});
|
|
49
49
|
this.experiment = void 0;
|
|
@@ -59,7 +59,7 @@ var BraintrustVitestEvalsReporter = class {
|
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
const experimentName = _nullishCoalesce(this.options.experimentName, () => ( `vitest-evals-${(/* @__PURE__ */ new Date()).toISOString()}`));
|
|
62
|
-
this.experiment =
|
|
62
|
+
this.experiment = _chunkGSIDVFE6js.initExperiment.call(void 0, {
|
|
63
63
|
...projectId ? { projectId } : { project: projectName },
|
|
64
64
|
experiment: experimentName,
|
|
65
65
|
metadata: this.options.metadata,
|
|
@@ -273,7 +273,7 @@ function logToolCallSpans(rootSpan, calls) {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
function readEvalTaskMeta(input) {
|
|
276
|
-
if (!
|
|
276
|
+
if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
|
|
277
277
|
const evalMeta = readEvalMeta(input.eval);
|
|
278
278
|
const harnessMeta = readHarnessMeta(input.harness);
|
|
279
279
|
if (!evalMeta && !harnessMeta) return void 0;
|
|
@@ -283,7 +283,7 @@ function readEvalTaskMeta(input) {
|
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
function readEvalMeta(input) {
|
|
286
|
-
if (!
|
|
286
|
+
if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
|
|
287
287
|
const avgScore = readFiniteOrNull(input.avgScore);
|
|
288
288
|
const scores = Array.isArray(input.scores) ? input.scores.map(readEvalScore).filter(isDefined) : void 0;
|
|
289
289
|
const toolCalls = Array.isArray(input.toolCalls) ? input.toolCalls.map(readToolCall).filter(isDefined) : void 0;
|
|
@@ -296,23 +296,23 @@ function readEvalMeta(input) {
|
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
298
|
function readEvalScore(input) {
|
|
299
|
-
if (!
|
|
299
|
+
if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
|
|
300
300
|
const score = readFiniteOrNull(input.score);
|
|
301
301
|
return {
|
|
302
302
|
...typeof input.name === "string" ? { name: input.name } : {},
|
|
303
303
|
...score !== void 0 ? { score } : {},
|
|
304
|
-
...
|
|
304
|
+
..._chunkGSIDVFE6js.isObject.call(void 0, input.metadata) ? { metadata: input.metadata } : {}
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
function readHarnessMeta(input) {
|
|
308
|
-
if (!
|
|
308
|
+
if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
|
|
309
309
|
return {
|
|
310
310
|
...typeof input.name === "string" ? { name: input.name } : {},
|
|
311
|
-
...
|
|
311
|
+
..._chunkGSIDVFE6js.isObject.call(void 0, input.run) ? { run: input.run } : {}
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
function readToolCall(input) {
|
|
315
|
-
if (!
|
|
315
|
+
if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
|
|
316
316
|
return input;
|
|
317
317
|
}
|
|
318
318
|
function filteredNormalizedSpanAttributes(attributes) {
|
|
@@ -372,10 +372,10 @@ function epochSeconds(value) {
|
|
|
372
372
|
}
|
|
373
373
|
function logReporterError(span, error) {
|
|
374
374
|
if (error instanceof Error) {
|
|
375
|
-
|
|
375
|
+
_chunkGSIDVFE6js.logError.call(void 0, span, error);
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
378
|
-
if (
|
|
378
|
+
if (_chunkGSIDVFE6js.isObject.call(void 0, error)) {
|
|
379
379
|
const message = typeof error.message === "string" ? error.message : void 0;
|
|
380
380
|
const stack = typeof error.stack === "string" ? error.stack : void 0;
|
|
381
381
|
if (message !== void 0 || stack !== void 0) {
|
|
@@ -387,10 +387,10 @@ ${stack}` : message
|
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
_chunkGSIDVFE6js.logError.call(void 0, span, error);
|
|
391
391
|
}
|
|
392
392
|
function formatErrorMessage(error) {
|
|
393
|
-
if (
|
|
393
|
+
if (_chunkGSIDVFE6js.isObject.call(void 0, error)) {
|
|
394
394
|
if (typeof error.message === "string") return error.message;
|
|
395
395
|
if (typeof error.stack === "string") return error.stack;
|
|
396
396
|
}
|