braintrust 0.0.174 → 0.0.175
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/browser.d.mts +1 -3
- package/dist/browser.d.ts +1 -3
- package/dist/browser.js +3 -1
- package/dist/browser.mjs +3 -1
- package/dist/cli.js +60 -145
- package/dist/index.d.mts +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +6 -91
- package/dist/index.mjs +6 -91
- package/package.json +2 -2
package/dist/browser.d.mts
CHANGED
|
@@ -16,8 +16,6 @@ declare class LazyValue<T> {
|
|
|
16
16
|
get hasComputed(): boolean;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/// <reference lib="dom" />
|
|
20
|
-
|
|
21
19
|
type SetCurrentArg = {
|
|
22
20
|
setCurrent?: boolean;
|
|
23
21
|
};
|
|
@@ -940,7 +938,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
|
|
|
940
938
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
941
939
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
942
940
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
943
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
941
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
944
942
|
* @param options Additional logging options
|
|
945
943
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
946
944
|
* @returns The `id` of the logged event.
|
package/dist/browser.d.ts
CHANGED
|
@@ -16,8 +16,6 @@ declare class LazyValue<T> {
|
|
|
16
16
|
get hasComputed(): boolean;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/// <reference lib="dom" />
|
|
20
|
-
|
|
21
19
|
type SetCurrentArg = {
|
|
22
20
|
setCurrent?: boolean;
|
|
23
21
|
};
|
|
@@ -940,7 +938,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
|
|
|
940
938
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
941
939
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
942
940
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
943
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
941
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
944
942
|
* @param options Additional logging options
|
|
945
943
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
946
944
|
* @returns The `id` of the logged event.
|
package/dist/browser.js
CHANGED
|
@@ -2545,6 +2545,8 @@ function deepCopyEvent(event) {
|
|
|
2545
2545
|
} else if (v instanceof Attachment) {
|
|
2546
2546
|
const idx = attachments.push(v);
|
|
2547
2547
|
return { [IDENTIFIER]: idx - 1 };
|
|
2548
|
+
} else if (v instanceof ReadonlyAttachment) {
|
|
2549
|
+
return v.reference;
|
|
2548
2550
|
}
|
|
2549
2551
|
return v;
|
|
2550
2552
|
});
|
|
@@ -2713,7 +2715,7 @@ var Experiment = class extends ObjectFetcher {
|
|
|
2713
2715
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
2714
2716
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
2715
2717
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
2716
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
2718
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
2717
2719
|
* @param options Additional logging options
|
|
2718
2720
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
2719
2721
|
* @returns The `id` of the logged event.
|
package/dist/browser.mjs
CHANGED
|
@@ -2495,6 +2495,8 @@ function deepCopyEvent(event) {
|
|
|
2495
2495
|
} else if (v instanceof Attachment) {
|
|
2496
2496
|
const idx = attachments.push(v);
|
|
2497
2497
|
return { [IDENTIFIER]: idx - 1 };
|
|
2498
|
+
} else if (v instanceof ReadonlyAttachment) {
|
|
2499
|
+
return v.reference;
|
|
2498
2500
|
}
|
|
2499
2501
|
return v;
|
|
2500
2502
|
});
|
|
@@ -2663,7 +2665,7 @@ var Experiment = class extends ObjectFetcher {
|
|
|
2663
2665
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
2664
2666
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
2665
2667
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
2666
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
2668
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
2667
2669
|
* @param options Additional logging options
|
|
2668
2670
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
2669
2671
|
* @returns The `id` of the logged event.
|
package/dist/cli.js
CHANGED
|
@@ -31,9 +31,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
));
|
|
32
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js
|
|
35
35
|
var require_async = __commonJS({
|
|
36
|
-
"
|
|
36
|
+
"../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js"(exports2) {
|
|
37
37
|
"use strict";
|
|
38
38
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
39
39
|
exports2.read = void 0;
|
|
@@ -73,9 +73,9 @@ var require_async = __commonJS({
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
//
|
|
76
|
+
// ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js
|
|
77
77
|
var require_sync = __commonJS({
|
|
78
|
-
"
|
|
78
|
+
"../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js"(exports2) {
|
|
79
79
|
"use strict";
|
|
80
80
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
81
81
|
exports2.read = void 0;
|
|
@@ -101,9 +101,9 @@ var require_sync = __commonJS({
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
//
|
|
104
|
+
// ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js
|
|
105
105
|
var require_fs = __commonJS({
|
|
106
|
-
"
|
|
106
|
+
"../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js"(exports2) {
|
|
107
107
|
"use strict";
|
|
108
108
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
109
109
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
@@ -124,9 +124,9 @@ var require_fs = __commonJS({
|
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
//
|
|
127
|
+
// ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js
|
|
128
128
|
var require_settings = __commonJS({
|
|
129
|
-
"
|
|
129
|
+
"../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
|
|
130
130
|
"use strict";
|
|
131
131
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
132
132
|
var fs6 = require_fs();
|
|
@@ -146,9 +146,9 @@ var require_settings = __commonJS({
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
|
|
149
|
-
//
|
|
149
|
+
// ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js
|
|
150
150
|
var require_out = __commonJS({
|
|
151
|
-
"
|
|
151
|
+
"../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/index.js"(exports2) {
|
|
152
152
|
"use strict";
|
|
153
153
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
154
154
|
exports2.statSync = exports2.stat = exports2.Settings = void 0;
|
|
@@ -178,9 +178,9 @@ var require_out = __commonJS({
|
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
//
|
|
181
|
+
// ../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js
|
|
182
182
|
var require_queue_microtask = __commonJS({
|
|
183
|
-
"
|
|
183
|
+
"../../node_modules/.pnpm/queue-microtask@1.2.3/node_modules/queue-microtask/index.js"(exports2, module2) {
|
|
184
184
|
"use strict";
|
|
185
185
|
var promise;
|
|
186
186
|
module2.exports = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : global) : (cb) => (promise || (promise = Promise.resolve())).then(cb).catch((err) => setTimeout(() => {
|
|
@@ -189,9 +189,9 @@ var require_queue_microtask = __commonJS({
|
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
|
|
192
|
-
//
|
|
192
|
+
// ../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js
|
|
193
193
|
var require_run_parallel = __commonJS({
|
|
194
|
-
"
|
|
194
|
+
"../../node_modules/.pnpm/run-parallel@1.2.0/node_modules/run-parallel/index.js"(exports2, module2) {
|
|
195
195
|
"use strict";
|
|
196
196
|
module2.exports = runParallel;
|
|
197
197
|
var queueMicrotask2 = require_queue_microtask();
|
|
@@ -243,9 +243,9 @@ var require_run_parallel = __commonJS({
|
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
-
//
|
|
246
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js
|
|
247
247
|
var require_constants = __commonJS({
|
|
248
|
-
"
|
|
248
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/constants.js"(exports2) {
|
|
249
249
|
"use strict";
|
|
250
250
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
251
251
|
exports2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
|
|
@@ -263,9 +263,9 @@ var require_constants = __commonJS({
|
|
|
263
263
|
}
|
|
264
264
|
});
|
|
265
265
|
|
|
266
|
-
//
|
|
266
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js
|
|
267
267
|
var require_fs2 = __commonJS({
|
|
268
|
-
"
|
|
268
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/fs.js"(exports2) {
|
|
269
269
|
"use strict";
|
|
270
270
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
271
271
|
exports2.createDirentFromStats = void 0;
|
|
@@ -288,9 +288,9 @@ var require_fs2 = __commonJS({
|
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
290
|
|
|
291
|
-
//
|
|
291
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js
|
|
292
292
|
var require_utils = __commonJS({
|
|
293
|
-
"
|
|
293
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js"(exports2) {
|
|
294
294
|
"use strict";
|
|
295
295
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
296
296
|
exports2.fs = void 0;
|
|
@@ -299,9 +299,9 @@ var require_utils = __commonJS({
|
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
-
//
|
|
302
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js
|
|
303
303
|
var require_common = __commonJS({
|
|
304
|
-
"
|
|
304
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/common.js"(exports2) {
|
|
305
305
|
"use strict";
|
|
306
306
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
307
307
|
exports2.joinPathSegments = void 0;
|
|
@@ -315,9 +315,9 @@ var require_common = __commonJS({
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
|
|
318
|
-
//
|
|
318
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js
|
|
319
319
|
var require_async2 = __commonJS({
|
|
320
|
-
"
|
|
320
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/async.js"(exports2) {
|
|
321
321
|
"use strict";
|
|
322
322
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
323
323
|
exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
|
|
@@ -425,9 +425,9 @@ var require_async2 = __commonJS({
|
|
|
425
425
|
}
|
|
426
426
|
});
|
|
427
427
|
|
|
428
|
-
//
|
|
428
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js
|
|
429
429
|
var require_sync2 = __commonJS({
|
|
430
|
-
"
|
|
430
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/providers/sync.js"(exports2) {
|
|
431
431
|
"use strict";
|
|
432
432
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
433
433
|
exports2.readdir = exports2.readdirWithFileTypes = exports2.read = void 0;
|
|
@@ -484,9 +484,9 @@ var require_sync2 = __commonJS({
|
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
486
|
|
|
487
|
-
//
|
|
487
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js
|
|
488
488
|
var require_fs3 = __commonJS({
|
|
489
|
-
"
|
|
489
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(exports2) {
|
|
490
490
|
"use strict";
|
|
491
491
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
492
492
|
exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
|
|
@@ -509,9 +509,9 @@ var require_fs3 = __commonJS({
|
|
|
509
509
|
}
|
|
510
510
|
});
|
|
511
511
|
|
|
512
|
-
//
|
|
512
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js
|
|
513
513
|
var require_settings2 = __commonJS({
|
|
514
|
-
"
|
|
514
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
|
|
515
515
|
"use strict";
|
|
516
516
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
517
517
|
var path9 = require("path");
|
|
@@ -539,9 +539,9 @@ var require_settings2 = __commonJS({
|
|
|
539
539
|
}
|
|
540
540
|
});
|
|
541
541
|
|
|
542
|
-
//
|
|
542
|
+
// ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js
|
|
543
543
|
var require_out2 = __commonJS({
|
|
544
|
-
"
|
|
544
|
+
"../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/index.js"(exports2) {
|
|
545
545
|
"use strict";
|
|
546
546
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
547
547
|
exports2.Settings = exports2.scandirSync = exports2.scandir = void 0;
|
|
@@ -571,9 +571,9 @@ var require_out2 = __commonJS({
|
|
|
571
571
|
}
|
|
572
572
|
});
|
|
573
573
|
|
|
574
|
-
//
|
|
574
|
+
// ../../node_modules/.pnpm/reusify@1.0.4/node_modules/reusify/reusify.js
|
|
575
575
|
var require_reusify = __commonJS({
|
|
576
|
-
"
|
|
576
|
+
"../../node_modules/.pnpm/reusify@1.0.4/node_modules/reusify/reusify.js"(exports2, module2) {
|
|
577
577
|
"use strict";
|
|
578
578
|
function reusify(Constructor) {
|
|
579
579
|
var head = new Constructor();
|
|
@@ -602,9 +602,9 @@ var require_reusify = __commonJS({
|
|
|
602
602
|
}
|
|
603
603
|
});
|
|
604
604
|
|
|
605
|
-
//
|
|
605
|
+
// ../../node_modules/.pnpm/fastq@1.16.0/node_modules/fastq/queue.js
|
|
606
606
|
var require_queue = __commonJS({
|
|
607
|
-
"
|
|
607
|
+
"../../node_modules/.pnpm/fastq@1.16.0/node_modules/fastq/queue.js"(exports2, module2) {
|
|
608
608
|
"use strict";
|
|
609
609
|
var reusify = require_reusify();
|
|
610
610
|
function fastqueue(context2, worker, concurrency) {
|
|
@@ -844,9 +844,9 @@ var require_queue = __commonJS({
|
|
|
844
844
|
}
|
|
845
845
|
});
|
|
846
846
|
|
|
847
|
-
//
|
|
847
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js
|
|
848
848
|
var require_common2 = __commonJS({
|
|
849
|
-
"
|
|
849
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/common.js"(exports2) {
|
|
850
850
|
"use strict";
|
|
851
851
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
852
852
|
exports2.joinPathSegments = exports2.replacePathSegmentSeparator = exports2.isAppliedFilter = exports2.isFatalError = void 0;
|
|
@@ -878,9 +878,9 @@ var require_common2 = __commonJS({
|
|
|
878
878
|
}
|
|
879
879
|
});
|
|
880
880
|
|
|
881
|
-
//
|
|
881
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js
|
|
882
882
|
var require_reader = __commonJS({
|
|
883
|
-
"
|
|
883
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/reader.js"(exports2) {
|
|
884
884
|
"use strict";
|
|
885
885
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
886
886
|
var common = require_common2();
|
|
@@ -895,9 +895,9 @@ var require_reader = __commonJS({
|
|
|
895
895
|
}
|
|
896
896
|
});
|
|
897
897
|
|
|
898
|
-
//
|
|
898
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js
|
|
899
899
|
var require_async3 = __commonJS({
|
|
900
|
-
"
|
|
900
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/async.js"(exports2) {
|
|
901
901
|
"use strict";
|
|
902
902
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
903
903
|
var events_1 = require("events");
|
|
@@ -998,9 +998,9 @@ var require_async3 = __commonJS({
|
|
|
998
998
|
}
|
|
999
999
|
});
|
|
1000
1000
|
|
|
1001
|
-
//
|
|
1001
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js
|
|
1002
1002
|
var require_async4 = __commonJS({
|
|
1003
|
-
"
|
|
1003
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.js"(exports2) {
|
|
1004
1004
|
"use strict";
|
|
1005
1005
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1006
1006
|
var async_1 = require_async3();
|
|
@@ -1034,9 +1034,9 @@ var require_async4 = __commonJS({
|
|
|
1034
1034
|
}
|
|
1035
1035
|
});
|
|
1036
1036
|
|
|
1037
|
-
//
|
|
1037
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js
|
|
1038
1038
|
var require_stream = __commonJS({
|
|
1039
|
-
"
|
|
1039
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/stream.js"(exports2) {
|
|
1040
1040
|
"use strict";
|
|
1041
1041
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1042
1042
|
var stream_1 = require("stream");
|
|
@@ -1075,9 +1075,9 @@ var require_stream = __commonJS({
|
|
|
1075
1075
|
}
|
|
1076
1076
|
});
|
|
1077
1077
|
|
|
1078
|
-
//
|
|
1078
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js
|
|
1079
1079
|
var require_sync3 = __commonJS({
|
|
1080
|
-
"
|
|
1080
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/readers/sync.js"(exports2) {
|
|
1081
1081
|
"use strict";
|
|
1082
1082
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1083
1083
|
var fsScandir = require_out2();
|
|
@@ -1139,9 +1139,9 @@ var require_sync3 = __commonJS({
|
|
|
1139
1139
|
}
|
|
1140
1140
|
});
|
|
1141
1141
|
|
|
1142
|
-
//
|
|
1142
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js
|
|
1143
1143
|
var require_sync4 = __commonJS({
|
|
1144
|
-
"
|
|
1144
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.js"(exports2) {
|
|
1145
1145
|
"use strict";
|
|
1146
1146
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1147
1147
|
var sync_1 = require_sync3();
|
|
@@ -1159,9 +1159,9 @@ var require_sync4 = __commonJS({
|
|
|
1159
1159
|
}
|
|
1160
1160
|
});
|
|
1161
1161
|
|
|
1162
|
-
//
|
|
1162
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js
|
|
1163
1163
|
var require_settings3 = __commonJS({
|
|
1164
|
-
"
|
|
1164
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
|
|
1165
1165
|
"use strict";
|
|
1166
1166
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1167
1167
|
var path9 = require("path");
|
|
@@ -1191,9 +1191,9 @@ var require_settings3 = __commonJS({
|
|
|
1191
1191
|
}
|
|
1192
1192
|
});
|
|
1193
1193
|
|
|
1194
|
-
//
|
|
1194
|
+
// ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js
|
|
1195
1195
|
var require_out3 = __commonJS({
|
|
1196
|
-
"
|
|
1196
|
+
"../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/index.js"(exports2) {
|
|
1197
1197
|
"use strict";
|
|
1198
1198
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1199
1199
|
exports2.Settings = exports2.walkStream = exports2.walkSync = exports2.walk = void 0;
|
|
@@ -1236,7 +1236,7 @@ var require_package = __commonJS({
|
|
|
1236
1236
|
"package.json"(exports2, module2) {
|
|
1237
1237
|
module2.exports = {
|
|
1238
1238
|
name: "braintrust",
|
|
1239
|
-
version: "0.0.
|
|
1239
|
+
version: "0.0.175",
|
|
1240
1240
|
description: "SDK for integrating Braintrust",
|
|
1241
1241
|
repository: {
|
|
1242
1242
|
type: "git",
|
|
@@ -1311,7 +1311,7 @@ var require_package = __commonJS({
|
|
|
1311
1311
|
},
|
|
1312
1312
|
dependencies: {
|
|
1313
1313
|
"@ai-sdk/provider": "^1.0.1",
|
|
1314
|
-
"@braintrust/core": "0.0.
|
|
1314
|
+
"@braintrust/core": "0.0.69",
|
|
1315
1315
|
"@next/env": "^14.2.3",
|
|
1316
1316
|
"@vercel/functions": "^1.0.2",
|
|
1317
1317
|
ai: "^3.2.16",
|
|
@@ -3514,6 +3514,8 @@ function deepCopyEvent(event) {
|
|
|
3514
3514
|
} else if (v instanceof Attachment) {
|
|
3515
3515
|
const idx = attachments.push(v);
|
|
3516
3516
|
return { [IDENTIFIER]: idx - 1 };
|
|
3517
|
+
} else if (v instanceof ReadonlyAttachment) {
|
|
3518
|
+
return v.reference;
|
|
3517
3519
|
}
|
|
3518
3520
|
return v;
|
|
3519
3521
|
});
|
|
@@ -3682,7 +3684,7 @@ var Experiment = class extends ObjectFetcher {
|
|
|
3682
3684
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
3683
3685
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
3684
3686
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
3685
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
3687
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
3686
3688
|
* @param options Additional logging options
|
|
3687
3689
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
3688
3690
|
* @returns The `id` of the logged event.
|
|
@@ -4576,7 +4578,7 @@ var import_chalk = __toESM(require("chalk"));
|
|
|
4576
4578
|
var import_core2 = require("@braintrust/core");
|
|
4577
4579
|
var import_pluralize = __toESM(require("pluralize"));
|
|
4578
4580
|
|
|
4579
|
-
//
|
|
4581
|
+
// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/dist/async.mjs
|
|
4580
4582
|
function initialParams(fn) {
|
|
4581
4583
|
return function(...args) {
|
|
4582
4584
|
var callback = args.pop();
|
|
@@ -5551,93 +5553,6 @@ function queue(worker, concurrency) {
|
|
|
5551
5553
|
_worker(items[0], cb);
|
|
5552
5554
|
}, concurrency, 1);
|
|
5553
5555
|
}
|
|
5554
|
-
var Heap = class {
|
|
5555
|
-
constructor() {
|
|
5556
|
-
this.heap = [];
|
|
5557
|
-
this.pushCount = Number.MIN_SAFE_INTEGER;
|
|
5558
|
-
}
|
|
5559
|
-
get length() {
|
|
5560
|
-
return this.heap.length;
|
|
5561
|
-
}
|
|
5562
|
-
empty() {
|
|
5563
|
-
this.heap = [];
|
|
5564
|
-
return this;
|
|
5565
|
-
}
|
|
5566
|
-
percUp(index) {
|
|
5567
|
-
let p;
|
|
5568
|
-
while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) {
|
|
5569
|
-
let t = this.heap[index];
|
|
5570
|
-
this.heap[index] = this.heap[p];
|
|
5571
|
-
this.heap[p] = t;
|
|
5572
|
-
index = p;
|
|
5573
|
-
}
|
|
5574
|
-
}
|
|
5575
|
-
percDown(index) {
|
|
5576
|
-
let l;
|
|
5577
|
-
while ((l = leftChi(index)) < this.heap.length) {
|
|
5578
|
-
if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) {
|
|
5579
|
-
l = l + 1;
|
|
5580
|
-
}
|
|
5581
|
-
if (smaller(this.heap[index], this.heap[l])) {
|
|
5582
|
-
break;
|
|
5583
|
-
}
|
|
5584
|
-
let t = this.heap[index];
|
|
5585
|
-
this.heap[index] = this.heap[l];
|
|
5586
|
-
this.heap[l] = t;
|
|
5587
|
-
index = l;
|
|
5588
|
-
}
|
|
5589
|
-
}
|
|
5590
|
-
push(node) {
|
|
5591
|
-
node.pushCount = ++this.pushCount;
|
|
5592
|
-
this.heap.push(node);
|
|
5593
|
-
this.percUp(this.heap.length - 1);
|
|
5594
|
-
}
|
|
5595
|
-
unshift(node) {
|
|
5596
|
-
return this.heap.push(node);
|
|
5597
|
-
}
|
|
5598
|
-
shift() {
|
|
5599
|
-
let [top] = this.heap;
|
|
5600
|
-
this.heap[0] = this.heap[this.heap.length - 1];
|
|
5601
|
-
this.heap.pop();
|
|
5602
|
-
this.percDown(0);
|
|
5603
|
-
return top;
|
|
5604
|
-
}
|
|
5605
|
-
toArray() {
|
|
5606
|
-
return [...this];
|
|
5607
|
-
}
|
|
5608
|
-
*[Symbol.iterator]() {
|
|
5609
|
-
for (let i = 0; i < this.heap.length; i++) {
|
|
5610
|
-
yield this.heap[i].data;
|
|
5611
|
-
}
|
|
5612
|
-
}
|
|
5613
|
-
remove(testFn) {
|
|
5614
|
-
let j = 0;
|
|
5615
|
-
for (let i = 0; i < this.heap.length; i++) {
|
|
5616
|
-
if (!testFn(this.heap[i])) {
|
|
5617
|
-
this.heap[j] = this.heap[i];
|
|
5618
|
-
j++;
|
|
5619
|
-
}
|
|
5620
|
-
}
|
|
5621
|
-
this.heap.splice(j);
|
|
5622
|
-
for (let i = parent(this.heap.length - 1); i >= 0; i--) {
|
|
5623
|
-
this.percDown(i);
|
|
5624
|
-
}
|
|
5625
|
-
return this;
|
|
5626
|
-
}
|
|
5627
|
-
};
|
|
5628
|
-
function leftChi(i) {
|
|
5629
|
-
return (i << 1) + 1;
|
|
5630
|
-
}
|
|
5631
|
-
function parent(i) {
|
|
5632
|
-
return (i + 1 >> 1) - 1;
|
|
5633
|
-
}
|
|
5634
|
-
function smaller(x, y) {
|
|
5635
|
-
if (x.priority !== y.priority) {
|
|
5636
|
-
return x.priority < y.priority;
|
|
5637
|
-
} else {
|
|
5638
|
-
return x.pushCount < y.pushCount;
|
|
5639
|
-
}
|
|
5640
|
-
}
|
|
5641
5556
|
function race(tasks, callback) {
|
|
5642
5557
|
callback = once(callback);
|
|
5643
5558
|
if (!Array.isArray(tasks))
|
package/dist/index.d.mts
CHANGED
|
@@ -17,8 +17,6 @@ declare class LazyValue<T> {
|
|
|
17
17
|
get hasComputed(): boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
/// <reference lib="dom" />
|
|
21
|
-
|
|
22
20
|
type SetCurrentArg = {
|
|
23
21
|
setCurrent?: boolean;
|
|
24
22
|
};
|
|
@@ -169,10 +167,10 @@ declare const loginSchema: z.ZodObject<{
|
|
|
169
167
|
fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["dirty", "tag", "commit", "branch", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
|
|
170
168
|
}, "strict", z.ZodTypeAny, {
|
|
171
169
|
collect: "some" | "none" | "all";
|
|
172
|
-
fields?: ("
|
|
170
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
173
171
|
}, {
|
|
174
172
|
collect: "some" | "none" | "all";
|
|
175
|
-
fields?: ("
|
|
173
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
176
174
|
}>>>;
|
|
177
175
|
}, "strict", z.ZodTypeAny, {
|
|
178
176
|
appUrl: string;
|
|
@@ -184,7 +182,7 @@ declare const loginSchema: z.ZodObject<{
|
|
|
184
182
|
orgId?: string | null | undefined;
|
|
185
183
|
gitMetadataSettings?: {
|
|
186
184
|
collect: "some" | "none" | "all";
|
|
187
|
-
fields?: ("
|
|
185
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
188
186
|
} | null | undefined;
|
|
189
187
|
}, {
|
|
190
188
|
appUrl: string;
|
|
@@ -196,7 +194,7 @@ declare const loginSchema: z.ZodObject<{
|
|
|
196
194
|
orgId?: string | null | undefined;
|
|
197
195
|
gitMetadataSettings?: {
|
|
198
196
|
collect: "some" | "none" | "all";
|
|
199
|
-
fields?: ("
|
|
197
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
200
198
|
} | null | undefined;
|
|
201
199
|
}>;
|
|
202
200
|
type SerializedBraintrustState = z.infer<typeof loginSchema>;
|
|
@@ -941,7 +939,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
|
|
|
941
939
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
942
940
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
943
941
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
944
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
942
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
945
943
|
* @param options Additional logging options
|
|
946
944
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
947
945
|
* @returns The `id` of the logged event.
|
package/dist/index.d.ts
CHANGED
|
@@ -17,8 +17,6 @@ declare class LazyValue<T> {
|
|
|
17
17
|
get hasComputed(): boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
/// <reference lib="dom" />
|
|
21
|
-
|
|
22
20
|
type SetCurrentArg = {
|
|
23
21
|
setCurrent?: boolean;
|
|
24
22
|
};
|
|
@@ -169,10 +167,10 @@ declare const loginSchema: z.ZodObject<{
|
|
|
169
167
|
fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["dirty", "tag", "commit", "branch", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
|
|
170
168
|
}, "strict", z.ZodTypeAny, {
|
|
171
169
|
collect: "some" | "none" | "all";
|
|
172
|
-
fields?: ("
|
|
170
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
173
171
|
}, {
|
|
174
172
|
collect: "some" | "none" | "all";
|
|
175
|
-
fields?: ("
|
|
173
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
176
174
|
}>>>;
|
|
177
175
|
}, "strict", z.ZodTypeAny, {
|
|
178
176
|
appUrl: string;
|
|
@@ -184,7 +182,7 @@ declare const loginSchema: z.ZodObject<{
|
|
|
184
182
|
orgId?: string | null | undefined;
|
|
185
183
|
gitMetadataSettings?: {
|
|
186
184
|
collect: "some" | "none" | "all";
|
|
187
|
-
fields?: ("
|
|
185
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
188
186
|
} | null | undefined;
|
|
189
187
|
}, {
|
|
190
188
|
appUrl: string;
|
|
@@ -196,7 +194,7 @@ declare const loginSchema: z.ZodObject<{
|
|
|
196
194
|
orgId?: string | null | undefined;
|
|
197
195
|
gitMetadataSettings?: {
|
|
198
196
|
collect: "some" | "none" | "all";
|
|
199
|
-
fields?: ("
|
|
197
|
+
fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
|
|
200
198
|
} | null | undefined;
|
|
201
199
|
}>;
|
|
202
200
|
type SerializedBraintrustState = z.infer<typeof loginSchema>;
|
|
@@ -941,7 +939,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
|
|
|
941
939
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
942
940
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
943
941
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
944
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
942
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
945
943
|
* @param options Additional logging options
|
|
946
944
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
947
945
|
* @returns The `id` of the logged event.
|
package/dist/index.js
CHANGED
|
@@ -2778,6 +2778,8 @@ function deepCopyEvent(event) {
|
|
|
2778
2778
|
} else if (v instanceof Attachment) {
|
|
2779
2779
|
const idx = attachments.push(v);
|
|
2780
2780
|
return { [IDENTIFIER]: idx - 1 };
|
|
2781
|
+
} else if (v instanceof ReadonlyAttachment) {
|
|
2782
|
+
return v.reference;
|
|
2781
2783
|
}
|
|
2782
2784
|
return v;
|
|
2783
2785
|
});
|
|
@@ -2946,7 +2948,7 @@ var Experiment = class extends ObjectFetcher {
|
|
|
2946
2948
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
2947
2949
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
2948
2950
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
2949
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
2951
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
2950
2952
|
* @param options Additional logging options
|
|
2951
2953
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
2952
2954
|
* @returns The `id` of the logged event.
|
|
@@ -3907,7 +3909,7 @@ async function invoke(args) {
|
|
|
3907
3909
|
forceLogin,
|
|
3908
3910
|
fetch: fetch2
|
|
3909
3911
|
});
|
|
3910
|
-
const
|
|
3912
|
+
const parent = parentArg ? typeof parentArg === "string" ? parentArg : await parentArg.export() : await getSpanParentObject().export();
|
|
3911
3913
|
const functionId = import_typespecs3.functionIdSchema.safeParse({
|
|
3912
3914
|
project_name: functionIdArgs.projectName,
|
|
3913
3915
|
slug: functionIdArgs.slug,
|
|
@@ -3925,7 +3927,7 @@ async function invoke(args) {
|
|
|
3925
3927
|
...functionId.data,
|
|
3926
3928
|
input,
|
|
3927
3929
|
messages,
|
|
3928
|
-
parent
|
|
3930
|
+
parent,
|
|
3929
3931
|
stream,
|
|
3930
3932
|
mode
|
|
3931
3933
|
};
|
|
@@ -3989,7 +3991,7 @@ var BarProgressReporter = class {
|
|
|
3989
3991
|
// src/framework.ts
|
|
3990
3992
|
var import_pluralize = __toESM(require("pluralize"));
|
|
3991
3993
|
|
|
3992
|
-
//
|
|
3994
|
+
// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/dist/async.mjs
|
|
3993
3995
|
function initialParams(fn) {
|
|
3994
3996
|
return function(...args) {
|
|
3995
3997
|
var callback = args.pop();
|
|
@@ -4964,93 +4966,6 @@ function queue(worker, concurrency) {
|
|
|
4964
4966
|
_worker(items[0], cb);
|
|
4965
4967
|
}, concurrency, 1);
|
|
4966
4968
|
}
|
|
4967
|
-
var Heap = class {
|
|
4968
|
-
constructor() {
|
|
4969
|
-
this.heap = [];
|
|
4970
|
-
this.pushCount = Number.MIN_SAFE_INTEGER;
|
|
4971
|
-
}
|
|
4972
|
-
get length() {
|
|
4973
|
-
return this.heap.length;
|
|
4974
|
-
}
|
|
4975
|
-
empty() {
|
|
4976
|
-
this.heap = [];
|
|
4977
|
-
return this;
|
|
4978
|
-
}
|
|
4979
|
-
percUp(index) {
|
|
4980
|
-
let p;
|
|
4981
|
-
while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) {
|
|
4982
|
-
let t = this.heap[index];
|
|
4983
|
-
this.heap[index] = this.heap[p];
|
|
4984
|
-
this.heap[p] = t;
|
|
4985
|
-
index = p;
|
|
4986
|
-
}
|
|
4987
|
-
}
|
|
4988
|
-
percDown(index) {
|
|
4989
|
-
let l;
|
|
4990
|
-
while ((l = leftChi(index)) < this.heap.length) {
|
|
4991
|
-
if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) {
|
|
4992
|
-
l = l + 1;
|
|
4993
|
-
}
|
|
4994
|
-
if (smaller(this.heap[index], this.heap[l])) {
|
|
4995
|
-
break;
|
|
4996
|
-
}
|
|
4997
|
-
let t = this.heap[index];
|
|
4998
|
-
this.heap[index] = this.heap[l];
|
|
4999
|
-
this.heap[l] = t;
|
|
5000
|
-
index = l;
|
|
5001
|
-
}
|
|
5002
|
-
}
|
|
5003
|
-
push(node) {
|
|
5004
|
-
node.pushCount = ++this.pushCount;
|
|
5005
|
-
this.heap.push(node);
|
|
5006
|
-
this.percUp(this.heap.length - 1);
|
|
5007
|
-
}
|
|
5008
|
-
unshift(node) {
|
|
5009
|
-
return this.heap.push(node);
|
|
5010
|
-
}
|
|
5011
|
-
shift() {
|
|
5012
|
-
let [top] = this.heap;
|
|
5013
|
-
this.heap[0] = this.heap[this.heap.length - 1];
|
|
5014
|
-
this.heap.pop();
|
|
5015
|
-
this.percDown(0);
|
|
5016
|
-
return top;
|
|
5017
|
-
}
|
|
5018
|
-
toArray() {
|
|
5019
|
-
return [...this];
|
|
5020
|
-
}
|
|
5021
|
-
*[Symbol.iterator]() {
|
|
5022
|
-
for (let i = 0; i < this.heap.length; i++) {
|
|
5023
|
-
yield this.heap[i].data;
|
|
5024
|
-
}
|
|
5025
|
-
}
|
|
5026
|
-
remove(testFn) {
|
|
5027
|
-
let j = 0;
|
|
5028
|
-
for (let i = 0; i < this.heap.length; i++) {
|
|
5029
|
-
if (!testFn(this.heap[i])) {
|
|
5030
|
-
this.heap[j] = this.heap[i];
|
|
5031
|
-
j++;
|
|
5032
|
-
}
|
|
5033
|
-
}
|
|
5034
|
-
this.heap.splice(j);
|
|
5035
|
-
for (let i = parent(this.heap.length - 1); i >= 0; i--) {
|
|
5036
|
-
this.percDown(i);
|
|
5037
|
-
}
|
|
5038
|
-
return this;
|
|
5039
|
-
}
|
|
5040
|
-
};
|
|
5041
|
-
function leftChi(i) {
|
|
5042
|
-
return (i << 1) + 1;
|
|
5043
|
-
}
|
|
5044
|
-
function parent(i) {
|
|
5045
|
-
return (i + 1 >> 1) - 1;
|
|
5046
|
-
}
|
|
5047
|
-
function smaller(x, y) {
|
|
5048
|
-
if (x.priority !== y.priority) {
|
|
5049
|
-
return x.priority < y.priority;
|
|
5050
|
-
} else {
|
|
5051
|
-
return x.pushCount < y.pushCount;
|
|
5052
|
-
}
|
|
5053
|
-
}
|
|
5054
4969
|
function race(tasks, callback) {
|
|
5055
4970
|
callback = once(callback);
|
|
5056
4971
|
if (!Array.isArray(tasks))
|
package/dist/index.mjs
CHANGED
|
@@ -2714,6 +2714,8 @@ function deepCopyEvent(event) {
|
|
|
2714
2714
|
} else if (v instanceof Attachment) {
|
|
2715
2715
|
const idx = attachments.push(v);
|
|
2716
2716
|
return { [IDENTIFIER]: idx - 1 };
|
|
2717
|
+
} else if (v instanceof ReadonlyAttachment) {
|
|
2718
|
+
return v.reference;
|
|
2717
2719
|
}
|
|
2718
2720
|
return v;
|
|
2719
2721
|
});
|
|
@@ -2882,7 +2884,7 @@ var Experiment = class extends ObjectFetcher {
|
|
|
2882
2884
|
* @param event.metadata: (Optional) a dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any JSON-serializable type, but its keys must be strings.
|
|
2883
2885
|
* @param event.metrics: (Optional) a dictionary of metrics to log. The following keys are populated automatically: "start", "end".
|
|
2884
2886
|
* @param event.id: (Optional) a unique identifier for the event. If you don't provide one, BrainTrust will generate one for you.
|
|
2885
|
-
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset.
|
|
2887
|
+
* @param event.dataset_record_id: (Optional) the id of the dataset record that this event is associated with. This field is required if and only if the experiment is associated with a dataset. This field is unused and will be removed in a future version.
|
|
2886
2888
|
* @param options Additional logging options
|
|
2887
2889
|
* @param options.allowConcurrentWithSpans in rare cases where you need to log at the top level separately from spans on the experiment elsewhere, set this to true.
|
|
2888
2890
|
* @returns The `id` of the logged event.
|
|
@@ -3845,7 +3847,7 @@ async function invoke(args) {
|
|
|
3845
3847
|
forceLogin,
|
|
3846
3848
|
fetch: fetch2
|
|
3847
3849
|
});
|
|
3848
|
-
const
|
|
3850
|
+
const parent = parentArg ? typeof parentArg === "string" ? parentArg : await parentArg.export() : await getSpanParentObject().export();
|
|
3849
3851
|
const functionId = functionIdSchema.safeParse({
|
|
3850
3852
|
project_name: functionIdArgs.projectName,
|
|
3851
3853
|
slug: functionIdArgs.slug,
|
|
@@ -3863,7 +3865,7 @@ async function invoke(args) {
|
|
|
3863
3865
|
...functionId.data,
|
|
3864
3866
|
input,
|
|
3865
3867
|
messages,
|
|
3866
|
-
parent
|
|
3868
|
+
parent,
|
|
3867
3869
|
stream,
|
|
3868
3870
|
mode
|
|
3869
3871
|
};
|
|
@@ -3927,7 +3929,7 @@ var BarProgressReporter = class {
|
|
|
3927
3929
|
// src/framework.ts
|
|
3928
3930
|
import pluralize from "pluralize";
|
|
3929
3931
|
|
|
3930
|
-
//
|
|
3932
|
+
// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/dist/async.mjs
|
|
3931
3933
|
function initialParams(fn) {
|
|
3932
3934
|
return function(...args) {
|
|
3933
3935
|
var callback = args.pop();
|
|
@@ -4902,93 +4904,6 @@ function queue(worker, concurrency) {
|
|
|
4902
4904
|
_worker(items[0], cb);
|
|
4903
4905
|
}, concurrency, 1);
|
|
4904
4906
|
}
|
|
4905
|
-
var Heap = class {
|
|
4906
|
-
constructor() {
|
|
4907
|
-
this.heap = [];
|
|
4908
|
-
this.pushCount = Number.MIN_SAFE_INTEGER;
|
|
4909
|
-
}
|
|
4910
|
-
get length() {
|
|
4911
|
-
return this.heap.length;
|
|
4912
|
-
}
|
|
4913
|
-
empty() {
|
|
4914
|
-
this.heap = [];
|
|
4915
|
-
return this;
|
|
4916
|
-
}
|
|
4917
|
-
percUp(index) {
|
|
4918
|
-
let p;
|
|
4919
|
-
while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) {
|
|
4920
|
-
let t = this.heap[index];
|
|
4921
|
-
this.heap[index] = this.heap[p];
|
|
4922
|
-
this.heap[p] = t;
|
|
4923
|
-
index = p;
|
|
4924
|
-
}
|
|
4925
|
-
}
|
|
4926
|
-
percDown(index) {
|
|
4927
|
-
let l;
|
|
4928
|
-
while ((l = leftChi(index)) < this.heap.length) {
|
|
4929
|
-
if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) {
|
|
4930
|
-
l = l + 1;
|
|
4931
|
-
}
|
|
4932
|
-
if (smaller(this.heap[index], this.heap[l])) {
|
|
4933
|
-
break;
|
|
4934
|
-
}
|
|
4935
|
-
let t = this.heap[index];
|
|
4936
|
-
this.heap[index] = this.heap[l];
|
|
4937
|
-
this.heap[l] = t;
|
|
4938
|
-
index = l;
|
|
4939
|
-
}
|
|
4940
|
-
}
|
|
4941
|
-
push(node) {
|
|
4942
|
-
node.pushCount = ++this.pushCount;
|
|
4943
|
-
this.heap.push(node);
|
|
4944
|
-
this.percUp(this.heap.length - 1);
|
|
4945
|
-
}
|
|
4946
|
-
unshift(node) {
|
|
4947
|
-
return this.heap.push(node);
|
|
4948
|
-
}
|
|
4949
|
-
shift() {
|
|
4950
|
-
let [top] = this.heap;
|
|
4951
|
-
this.heap[0] = this.heap[this.heap.length - 1];
|
|
4952
|
-
this.heap.pop();
|
|
4953
|
-
this.percDown(0);
|
|
4954
|
-
return top;
|
|
4955
|
-
}
|
|
4956
|
-
toArray() {
|
|
4957
|
-
return [...this];
|
|
4958
|
-
}
|
|
4959
|
-
*[Symbol.iterator]() {
|
|
4960
|
-
for (let i = 0; i < this.heap.length; i++) {
|
|
4961
|
-
yield this.heap[i].data;
|
|
4962
|
-
}
|
|
4963
|
-
}
|
|
4964
|
-
remove(testFn) {
|
|
4965
|
-
let j = 0;
|
|
4966
|
-
for (let i = 0; i < this.heap.length; i++) {
|
|
4967
|
-
if (!testFn(this.heap[i])) {
|
|
4968
|
-
this.heap[j] = this.heap[i];
|
|
4969
|
-
j++;
|
|
4970
|
-
}
|
|
4971
|
-
}
|
|
4972
|
-
this.heap.splice(j);
|
|
4973
|
-
for (let i = parent(this.heap.length - 1); i >= 0; i--) {
|
|
4974
|
-
this.percDown(i);
|
|
4975
|
-
}
|
|
4976
|
-
return this;
|
|
4977
|
-
}
|
|
4978
|
-
};
|
|
4979
|
-
function leftChi(i) {
|
|
4980
|
-
return (i << 1) + 1;
|
|
4981
|
-
}
|
|
4982
|
-
function parent(i) {
|
|
4983
|
-
return (i + 1 >> 1) - 1;
|
|
4984
|
-
}
|
|
4985
|
-
function smaller(x, y) {
|
|
4986
|
-
if (x.priority !== y.priority) {
|
|
4987
|
-
return x.priority < y.priority;
|
|
4988
|
-
} else {
|
|
4989
|
-
return x.pushCount < y.pushCount;
|
|
4990
|
-
}
|
|
4991
|
-
}
|
|
4992
4907
|
function race(tasks, callback) {
|
|
4993
4908
|
callback = once(callback);
|
|
4994
4909
|
if (!Array.isArray(tasks))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "braintrust",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.175",
|
|
4
4
|
"description": "SDK for integrating Braintrust",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@ai-sdk/provider": "^1.0.1",
|
|
78
|
-
"@braintrust/core": "0.0.
|
|
78
|
+
"@braintrust/core": "0.0.69",
|
|
79
79
|
"@next/env": "^14.2.3",
|
|
80
80
|
"@vercel/functions": "^1.0.2",
|
|
81
81
|
"ai": "^3.2.16",
|