braintrust 0.0.113 → 0.0.114
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.js +65 -45
- package/dist/cli.js +318 -141
- package/dist/framework.d.ts +57 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +206 -124
- package/dist/logger.d.ts +12 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
mod
|
|
25
25
|
));
|
|
26
26
|
|
|
27
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
27
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/zod-is-type.js
|
|
28
28
|
var require_zod_is_type = __commonJS({
|
|
29
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
29
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/zod-is-type.js"(exports) {
|
|
30
30
|
"use strict";
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.isAnyZodType = exports.isZodType = void 0;
|
|
@@ -42,9 +42,9 @@ var require_zod_is_type = __commonJS({
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
45
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/zod-extensions.js
|
|
46
46
|
var require_zod_extensions = __commonJS({
|
|
47
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
47
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/zod-extensions.js"(exports) {
|
|
48
48
|
"use strict";
|
|
49
49
|
var __rest = exports && exports.__rest || function(s, e) {
|
|
50
50
|
var t = {};
|
|
@@ -132,9 +132,9 @@ var require_zod_extensions = __commonJS({
|
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
135
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/object-set.js
|
|
136
136
|
var require_object_set = __commonJS({
|
|
137
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
137
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/object-set.js"(exports) {
|
|
138
138
|
"use strict";
|
|
139
139
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
140
140
|
exports.ObjectSet = exports.isEqual = void 0;
|
|
@@ -230,12 +230,12 @@ var require_object_set = __commonJS({
|
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
233
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/lodash.js
|
|
234
234
|
var require_lodash = __commonJS({
|
|
235
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
235
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/lodash.js"(exports) {
|
|
236
236
|
"use strict";
|
|
237
237
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
238
|
-
exports.uniq = exports.objectEquals = exports.compact = exports.omitBy = exports.omit = exports.mapValues = exports.isNil = exports.isUndefined = void 0;
|
|
238
|
+
exports.isString = exports.uniq = exports.objectEquals = exports.compact = exports.omitBy = exports.omit = exports.mapValues = exports.isNil = exports.isUndefined = void 0;
|
|
239
239
|
var object_set_1 = require_object_set();
|
|
240
240
|
function isUndefined(value) {
|
|
241
241
|
return value === void 0;
|
|
@@ -284,12 +284,16 @@ var require_lodash = __commonJS({
|
|
|
284
284
|
return [...set.values()];
|
|
285
285
|
}
|
|
286
286
|
exports.uniq = uniq;
|
|
287
|
+
function isString(val) {
|
|
288
|
+
return typeof val === "string";
|
|
289
|
+
}
|
|
290
|
+
exports.isString = isString;
|
|
287
291
|
}
|
|
288
292
|
});
|
|
289
293
|
|
|
290
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
294
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/openapi-metadata.js
|
|
291
295
|
var require_openapi_metadata = __commonJS({
|
|
292
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
296
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/openapi-metadata.js"(exports) {
|
|
293
297
|
"use strict";
|
|
294
298
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
295
299
|
exports.getOpenApiMetadata = void 0;
|
|
@@ -302,9 +306,9 @@ var require_openapi_metadata = __commonJS({
|
|
|
302
306
|
}
|
|
303
307
|
});
|
|
304
308
|
|
|
305
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
309
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/openapi-registry.js
|
|
306
310
|
var require_openapi_registry = __commonJS({
|
|
307
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
311
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/openapi-registry.js"(exports) {
|
|
308
312
|
"use strict";
|
|
309
313
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
310
314
|
exports.OpenAPIRegistry = void 0;
|
|
@@ -386,9 +390,9 @@ var require_openapi_registry = __commonJS({
|
|
|
386
390
|
}
|
|
387
391
|
});
|
|
388
392
|
|
|
389
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
393
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/errors.js
|
|
390
394
|
var require_errors = __commonJS({
|
|
391
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
395
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/errors.js"(exports) {
|
|
392
396
|
"use strict";
|
|
393
397
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
394
398
|
exports.UnknownZodTypeError = exports.MissingParameterDataError = exports.ConflictError = exports.ZodToOpenAPIError = void 0;
|
|
@@ -422,9 +426,9 @@ var require_errors = __commonJS({
|
|
|
422
426
|
}
|
|
423
427
|
});
|
|
424
428
|
|
|
425
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
429
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/enum-info.js
|
|
426
430
|
var require_enum_info = __commonJS({
|
|
427
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
431
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/lib/enum-info.js"(exports) {
|
|
428
432
|
"use strict";
|
|
429
433
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
430
434
|
exports.enumInfo = void 0;
|
|
@@ -439,9 +443,9 @@ var require_enum_info = __commonJS({
|
|
|
439
443
|
}
|
|
440
444
|
});
|
|
441
445
|
|
|
442
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
446
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/openapi-generator.js
|
|
443
447
|
var require_openapi_generator = __commonJS({
|
|
444
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
448
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/openapi-generator.js"(exports) {
|
|
445
449
|
"use strict";
|
|
446
450
|
var __rest = exports && exports.__rest || function(s, e) {
|
|
447
451
|
var t = {};
|
|
@@ -782,7 +786,7 @@ var require_openapi_generator = __commonJS({
|
|
|
782
786
|
}
|
|
783
787
|
getBodyContent(content) {
|
|
784
788
|
return (0, lodash_1.mapValues)(content, (config) => {
|
|
785
|
-
if (!(0, zod_is_type_1.isAnyZodType)(config.schema)) {
|
|
789
|
+
if (!config || !(0, zod_is_type_1.isAnyZodType)(config.schema)) {
|
|
786
790
|
return config;
|
|
787
791
|
}
|
|
788
792
|
const { schema: configSchema } = config, rest = __rest(config, ["schema"]);
|
|
@@ -970,7 +974,14 @@ var require_openapi_generator = __commonJS({
|
|
|
970
974
|
}
|
|
971
975
|
if ((0, zod_is_type_1.isZodType)(zodSchema, "ZodRecord")) {
|
|
972
976
|
const propertiesType = zodSchema._def.valueType;
|
|
973
|
-
|
|
977
|
+
const keyType = zodSchema._def.keyType;
|
|
978
|
+
const propertiesSchema = this.generateSchemaWithRef(propertiesType);
|
|
979
|
+
if ((0, zod_is_type_1.isZodType)(keyType, "ZodEnum") || (0, zod_is_type_1.isZodType)(keyType, "ZodNativeEnum")) {
|
|
980
|
+
const keys = Object.values(keyType.enum).filter(lodash_1.isString);
|
|
981
|
+
const properties = keys.reduce((acc, curr) => Object.assign(Object.assign({}, acc), { [curr]: propertiesSchema }), {});
|
|
982
|
+
return Object.assign(Object.assign({}, this.mapNullableType("object", isNullable)), { properties, default: defaultValue });
|
|
983
|
+
}
|
|
984
|
+
return Object.assign(Object.assign({}, this.mapNullableType("object", isNullable)), { additionalProperties: propertiesSchema, default: defaultValue });
|
|
974
985
|
}
|
|
975
986
|
if ((0, zod_is_type_1.isZodType)(zodSchema, "ZodUnknown") || (0, zod_is_type_1.isZodType)(zodSchema, "ZodAny")) {
|
|
976
987
|
return this.mapNullableType(void 0, isNullable);
|
|
@@ -1136,9 +1147,9 @@ var require_openapi_generator = __commonJS({
|
|
|
1136
1147
|
}
|
|
1137
1148
|
});
|
|
1138
1149
|
|
|
1139
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1150
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.0/specifics.js
|
|
1140
1151
|
var require_specifics = __commonJS({
|
|
1141
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1152
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.0/specifics.js"(exports) {
|
|
1142
1153
|
"use strict";
|
|
1143
1154
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1144
1155
|
exports.OpenApiGeneratorV30Specifics = void 0;
|
|
@@ -1172,9 +1183,9 @@ var require_specifics = __commonJS({
|
|
|
1172
1183
|
}
|
|
1173
1184
|
});
|
|
1174
1185
|
|
|
1175
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1186
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator.js
|
|
1176
1187
|
var require_openapi_generator2 = __commonJS({
|
|
1177
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1188
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator.js"(exports) {
|
|
1178
1189
|
"use strict";
|
|
1179
1190
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1180
1191
|
exports.OpenApiGeneratorV3 = void 0;
|
|
@@ -1197,9 +1208,9 @@ var require_openapi_generator2 = __commonJS({
|
|
|
1197
1208
|
}
|
|
1198
1209
|
});
|
|
1199
1210
|
|
|
1200
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1211
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.1/specifics.js
|
|
1201
1212
|
var require_specifics2 = __commonJS({
|
|
1202
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1213
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.1/specifics.js"(exports) {
|
|
1203
1214
|
"use strict";
|
|
1204
1215
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1205
1216
|
exports.OpenApiGeneratorV31Specifics = void 0;
|
|
@@ -1243,9 +1254,9 @@ var require_specifics2 = __commonJS({
|
|
|
1243
1254
|
}
|
|
1244
1255
|
});
|
|
1245
1256
|
|
|
1246
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1257
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.1/openapi-generator.js
|
|
1247
1258
|
var require_openapi_generator3 = __commonJS({
|
|
1248
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1259
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/v3.1/openapi-generator.js"(exports) {
|
|
1249
1260
|
"use strict";
|
|
1250
1261
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1251
1262
|
exports.OpenApiGeneratorV31 = void 0;
|
|
@@ -1279,9 +1290,9 @@ var require_openapi_generator3 = __commonJS({
|
|
|
1279
1290
|
}
|
|
1280
1291
|
});
|
|
1281
1292
|
|
|
1282
|
-
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1293
|
+
// ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/index.js
|
|
1283
1294
|
var require_dist = __commonJS({
|
|
1284
|
-
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.
|
|
1295
|
+
"../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@6.4.0_zod@3.22.4/node_modules/@asteasolutions/zod-to-openapi/dist/index.js"(exports) {
|
|
1285
1296
|
"use strict";
|
|
1286
1297
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1287
1298
|
if (k2 === void 0)
|
|
@@ -1397,7 +1408,7 @@ function v4(options, buf, offset) {
|
|
|
1397
1408
|
}
|
|
1398
1409
|
var v4_default = v4;
|
|
1399
1410
|
|
|
1400
|
-
//
|
|
1411
|
+
// ../../node_modules/.pnpm/@braintrust+core@0.0.27/node_modules/@braintrust/core/dist/index.mjs
|
|
1401
1412
|
var TRANSACTION_ID_FIELD = "_xact_id";
|
|
1402
1413
|
var IS_MERGE_FIELD = "_is_merge";
|
|
1403
1414
|
var MERGE_PATHS_FIELD = "_merge_paths";
|
|
@@ -1702,7 +1713,7 @@ var MOD = BigInt(1) << BigInt(64);
|
|
|
1702
1713
|
var COPRIME = BigInt("205891132094649");
|
|
1703
1714
|
var COPRIME_INVERSE = BigInt("1522336535492693385");
|
|
1704
1715
|
|
|
1705
|
-
//
|
|
1716
|
+
// ../../node_modules/.pnpm/@braintrust+core@0.0.27/node_modules/@braintrust/core/typespecs/dist/index.mjs
|
|
1706
1717
|
var import_zod_to_openapi = __toESM(require_dist(), 1);
|
|
1707
1718
|
|
|
1708
1719
|
// ../../node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
@@ -5438,7 +5449,7 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
5438
5449
|
ZodError
|
|
5439
5450
|
});
|
|
5440
5451
|
|
|
5441
|
-
//
|
|
5452
|
+
// ../../node_modules/.pnpm/@braintrust+core@0.0.27/node_modules/@braintrust/core/typespecs/dist/index.mjs
|
|
5442
5453
|
var import_zod_to_openapi2 = __toESM(require_dist(), 1);
|
|
5443
5454
|
var import_zod_to_openapi3 = __toESM(require_dist(), 1);
|
|
5444
5455
|
var literalSchema = z.union([
|
|
@@ -5483,12 +5494,12 @@ var modeToTypes = {
|
|
|
5483
5494
|
};
|
|
5484
5495
|
var customTypes = modeToTypes[mode];
|
|
5485
5496
|
var chatCompletionSystemMessageParamSchema = z.object({
|
|
5486
|
-
content: z.string(),
|
|
5497
|
+
content: z.string().default(""),
|
|
5487
5498
|
role: z.literal("system"),
|
|
5488
5499
|
name: z.string().optional()
|
|
5489
5500
|
});
|
|
5490
5501
|
var chatCompletionContentPartTextSchema = z.object({
|
|
5491
|
-
text: z.string(),
|
|
5502
|
+
text: z.string().default(""),
|
|
5492
5503
|
type: z.literal("text")
|
|
5493
5504
|
});
|
|
5494
5505
|
var functionCallSchema = z.object({
|
|
@@ -5504,12 +5515,12 @@ var imageURLSchema = z.object({
|
|
|
5504
5515
|
detail: z.union([z.literal("auto"), z.literal("low"), z.literal("high")]).optional()
|
|
5505
5516
|
});
|
|
5506
5517
|
var chatCompletionToolMessageParamSchema = z.object({
|
|
5507
|
-
content: z.string(),
|
|
5518
|
+
content: z.string().default(""),
|
|
5508
5519
|
role: z.literal("tool"),
|
|
5509
5520
|
tool_call_id: z.string()
|
|
5510
5521
|
});
|
|
5511
5522
|
var chatCompletionFunctionMessageParamSchema = z.object({
|
|
5512
|
-
content: z.string().
|
|
5523
|
+
content: z.string().default(""),
|
|
5513
5524
|
name: z.string(),
|
|
5514
5525
|
role: z.literal("function")
|
|
5515
5526
|
});
|
|
@@ -5528,13 +5539,16 @@ var chatCompletionContentPartSchema = z.union([
|
|
|
5528
5539
|
]);
|
|
5529
5540
|
var chatCompletionAssistantMessageParamSchema = z.object({
|
|
5530
5541
|
role: z.literal("assistant"),
|
|
5531
|
-
content: z.string().
|
|
5542
|
+
content: z.string().nullish(),
|
|
5532
5543
|
function_call: functionCallSchema.optional(),
|
|
5533
5544
|
name: z.string().optional(),
|
|
5534
5545
|
tool_calls: z.array(chatCompletionMessageToolCallSchema).optional()
|
|
5535
5546
|
});
|
|
5536
5547
|
var chatCompletionUserMessageParamSchema = z.object({
|
|
5537
|
-
content: z.union([
|
|
5548
|
+
content: z.union([
|
|
5549
|
+
z.string().default(""),
|
|
5550
|
+
z.array(chatCompletionContentPartSchema)
|
|
5551
|
+
]),
|
|
5538
5552
|
role: z.literal("user"),
|
|
5539
5553
|
name: z.string().optional()
|
|
5540
5554
|
});
|
|
@@ -6876,6 +6890,7 @@ var BraintrustState = class {
|
|
|
6876
6890
|
currentLogger;
|
|
6877
6891
|
currentSpan;
|
|
6878
6892
|
appUrl = null;
|
|
6893
|
+
appPublicUrl = null;
|
|
6879
6894
|
loginToken = null;
|
|
6880
6895
|
orgId = null;
|
|
6881
6896
|
orgName = null;
|
|
@@ -7219,12 +7234,13 @@ var Logger = class {
|
|
|
7219
7234
|
* See `traced` for full details.
|
|
7220
7235
|
*/
|
|
7221
7236
|
startSpan(args) {
|
|
7222
|
-
const { name, ...argsRest } = args ?? {};
|
|
7237
|
+
const { name, type, ...argsRest } = args ?? {};
|
|
7223
7238
|
return new SpanImpl({
|
|
7224
7239
|
parentObject: this,
|
|
7225
7240
|
parentIds: new LazyValue(() => this.lazyParentIds()),
|
|
7226
7241
|
bgLogger: this.bgLogger,
|
|
7227
7242
|
name: name ?? "root",
|
|
7243
|
+
type: type ?? SpanTypeAttribute.TASK,
|
|
7228
7244
|
...argsRest
|
|
7229
7245
|
});
|
|
7230
7246
|
}
|
|
@@ -7835,8 +7851,10 @@ async function login(options = {}) {
|
|
|
7835
7851
|
apiKey = isomorph_default.getEnv("BRAINTRUST_API_KEY"),
|
|
7836
7852
|
orgName = isomorph_default.getEnv("BRAINTRUST_ORG_NAME")
|
|
7837
7853
|
} = options || {};
|
|
7854
|
+
const appPublicUrl = isomorph_default.getEnv("BRAINTRUST_APP_PUBLIC_URL") || appUrl;
|
|
7838
7855
|
_state.resetLoginInfo();
|
|
7839
7856
|
_state.appUrl = appUrl;
|
|
7857
|
+
_state.appPublicUrl = appPublicUrl;
|
|
7840
7858
|
let conn = null;
|
|
7841
7859
|
if (apiKey !== void 0) {
|
|
7842
7860
|
const resp = await checkResponse(
|
|
@@ -8222,12 +8240,13 @@ var Experiment = class extends ObjectFetcher {
|
|
|
8222
8240
|
* See `traced` for full details.
|
|
8223
8241
|
*/
|
|
8224
8242
|
startSpan(args) {
|
|
8225
|
-
const { name, ...argsRest } = args ?? {};
|
|
8243
|
+
const { name, type, ...argsRest } = args ?? {};
|
|
8226
8244
|
return new SpanImpl({
|
|
8227
8245
|
parentObject: this,
|
|
8228
8246
|
parentIds: new LazyValue(() => this.lazyParentIds()),
|
|
8229
8247
|
bgLogger: this.bgLogger,
|
|
8230
8248
|
name: name ?? "root",
|
|
8249
|
+
type: type ?? SpanTypeAttribute.EVAL,
|
|
8231
8250
|
...argsRest
|
|
8232
8251
|
});
|
|
8233
8252
|
}
|
|
@@ -8263,7 +8282,7 @@ var Experiment = class extends ObjectFetcher {
|
|
|
8263
8282
|
let { summarizeScores = true, comparisonExperimentId = void 0 } = options || {};
|
|
8264
8283
|
await this.bgLogger.flush();
|
|
8265
8284
|
const state = await this.getState();
|
|
8266
|
-
const projectUrl = `${state.
|
|
8285
|
+
const projectUrl = `${state.appPublicUrl}/app/${encodeURIComponent(
|
|
8267
8286
|
state.orgName
|
|
8268
8287
|
)}/p/${encodeURIComponent((await this.project).name)}`;
|
|
8269
8288
|
const experimentUrl = `${projectUrl}/${encodeURIComponent(
|
|
@@ -8299,7 +8318,7 @@ var Experiment = class extends ObjectFetcher {
|
|
|
8299
8318
|
projectUrl,
|
|
8300
8319
|
experimentUrl,
|
|
8301
8320
|
comparisonExperimentName,
|
|
8302
|
-
scores,
|
|
8321
|
+
scores: scores ?? {},
|
|
8303
8322
|
metrics
|
|
8304
8323
|
};
|
|
8305
8324
|
}
|
|
@@ -8417,6 +8436,7 @@ var SpanImpl = class _SpanImpl {
|
|
|
8417
8436
|
},
|
|
8418
8437
|
context: { ...callerLocation },
|
|
8419
8438
|
span_attributes: {
|
|
8439
|
+
type: args.type,
|
|
8420
8440
|
...args.spanAttributes,
|
|
8421
8441
|
name,
|
|
8422
8442
|
exec_counter: executionCounter++
|
|
@@ -8651,7 +8671,7 @@ var Dataset = class extends ObjectFetcher {
|
|
|
8651
8671
|
let { summarizeData = true } = options || {};
|
|
8652
8672
|
await this.bgLogger.flush();
|
|
8653
8673
|
const state = await this.getState();
|
|
8654
|
-
const projectUrl = `${state.
|
|
8674
|
+
const projectUrl = `${state.appPublicUrl}/app/${encodeURIComponent(
|
|
8655
8675
|
state.orgName
|
|
8656
8676
|
)}/p/${encodeURIComponent((await this.project).name)}`;
|
|
8657
8677
|
const datasetUrl = `${projectUrl}/d/${encodeURIComponent(await this.name)}`;
|