braintrust 3.12.0 → 3.13.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.
Files changed (49) hide show
  1. package/dev/dist/index.d.mts +25 -6
  2. package/dev/dist/index.d.ts +25 -6
  3. package/dev/dist/index.js +134 -43
  4. package/dev/dist/index.mjs +113 -22
  5. package/dist/apply-auto-instrumentation.js +170 -170
  6. package/dist/apply-auto-instrumentation.mjs +1 -1
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +1 -0
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/next.cjs +1 -0
  10. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +1 -0
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  13. package/dist/auto-instrumentations/bundler/vite.cjs +1 -0
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +1 -0
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +1 -0
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  18. package/dist/auto-instrumentations/{chunk-2DPA74KK.mjs → chunk-E5DUYJWK.mjs} +1 -0
  19. package/dist/auto-instrumentations/{chunk-73BZUKVI.mjs → chunk-GJOO4ESL.mjs} +1 -1
  20. package/dist/auto-instrumentations/{chunk-AFXRW7I7.mjs → chunk-WFEUJACP.mjs} +1 -1
  21. package/dist/auto-instrumentations/hook.mjs +1 -0
  22. package/dist/auto-instrumentations/index.cjs +1 -0
  23. package/dist/auto-instrumentations/index.mjs +1 -1
  24. package/dist/browser.d.mts +149 -21
  25. package/dist/browser.d.ts +149 -21
  26. package/dist/browser.js +114 -24
  27. package/dist/browser.mjs +114 -24
  28. package/dist/{chunk-BW4DF4CY.js → chunk-26JGOELH.js} +1 -0
  29. package/dist/{chunk-MSLBGITU.mjs → chunk-75IQCUB2.mjs} +1 -0
  30. package/dist/cli.js +121 -44
  31. package/dist/edge-light.d.mts +1 -1
  32. package/dist/edge-light.d.ts +1 -1
  33. package/dist/edge-light.js +114 -24
  34. package/dist/edge-light.mjs +114 -24
  35. package/dist/index.d.mts +149 -21
  36. package/dist/index.d.ts +149 -21
  37. package/dist/index.js +529 -394
  38. package/dist/index.mjs +161 -26
  39. package/dist/instrumentation/index.d.mts +40 -3
  40. package/dist/instrumentation/index.d.ts +40 -3
  41. package/dist/instrumentation/index.js +15 -2
  42. package/dist/instrumentation/index.mjs +15 -2
  43. package/dist/workerd.d.mts +1 -1
  44. package/dist/workerd.d.ts +1 -1
  45. package/dist/workerd.js +114 -24
  46. package/dist/workerd.mjs +114 -24
  47. package/package.json +3 -17
  48. package/util/dist/index.d.mts +3 -1
  49. package/util/dist/index.d.ts +3 -1
package/dist/workerd.mjs CHANGED
@@ -89,6 +89,7 @@ var iso = {
89
89
  getRepoInfo: async (_settings) => void 0,
90
90
  getPastNAncestors: async () => [],
91
91
  getEnv: (_name) => void 0,
92
+ getBraintrustApiKey: async () => void 0,
92
93
  getCallerLocation: () => void 0,
93
94
  newAsyncLocalStorage: () => new DefaultAsyncLocalStorage(),
94
95
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5430,6 +5431,19 @@ var JSONAttachment = class extends Attachment {
5430
5431
  */
5431
5432
  constructor(data, options) {
5432
5433
  const { filename = "data.json", pretty = false, state } = options ?? {};
5434
+ const deferredJsonAttachment = globalThis.__BT_DATASET_PIPELINE_DEFER_JSON_ATTACHMENT__;
5435
+ if (deferredJsonAttachment) {
5436
+ super({
5437
+ data: new Blob([]),
5438
+ filename,
5439
+ contentType: "application/json",
5440
+ state
5441
+ });
5442
+ return deferredJsonAttachment(data, {
5443
+ filename,
5444
+ pretty
5445
+ });
5446
+ }
5433
5447
  const jsonString = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data);
5434
5448
  const blob = new Blob([jsonString], { type: "application/json" });
5435
5449
  super({
@@ -7422,10 +7436,11 @@ async function login(options = {}) {
7422
7436
  async function loginToState(options = {}) {
7423
7437
  const {
7424
7438
  appUrl = isomorph_default.getEnv("BRAINTRUST_APP_URL") || "https://www.braintrust.dev",
7425
- apiKey = isomorph_default.getEnv("BRAINTRUST_API_KEY"),
7439
+ apiKey: apiKeyArg,
7426
7440
  orgName = isomorph_default.getEnv("BRAINTRUST_ORG_NAME"),
7427
7441
  fetch: fetch2 = globalThis.fetch
7428
7442
  } = options || {};
7443
+ const apiKey = apiKeyArg !== void 0 ? apiKeyArg : await isomorph_default.getBraintrustApiKey();
7429
7444
  const appPublicUrl = isomorph_default.getEnv("BRAINTRUST_APP_PUBLIC_URL") || appUrl;
7430
7445
  const state = new BraintrustState(options);
7431
7446
  state.resetLoginInfo();
@@ -8666,9 +8681,15 @@ var SpanImpl = class _SpanImpl {
8666
8681
  const cachedSpan = {
8667
8682
  input: partialRecord.input,
8668
8683
  output: partialRecord.output,
8684
+ expected: partialRecord.expected,
8685
+ error: partialRecord.error,
8686
+ scores: partialRecord.scores,
8687
+ metrics: partialRecord.metrics,
8669
8688
  metadata: partialRecord.metadata,
8689
+ tags: partialRecord.tags,
8670
8690
  span_id: this._spanId,
8671
8691
  span_parents: this._spanParents,
8692
+ is_root: this._spanId === this._rootSpanId,
8672
8693
  span_attributes: partialRecord.span_attributes
8673
8694
  };
8674
8695
  this._state.spanCache.queueWrite(
@@ -9004,6 +9025,7 @@ var Dataset2 = class extends ObjectFetcher {
9004
9025
  metadata,
9005
9026
  tags,
9006
9027
  output,
9028
+ origin,
9007
9029
  isMerge
9008
9030
  }) {
9009
9031
  return new LazyValue(async () => {
@@ -9018,6 +9040,7 @@ var Dataset2 = class extends ObjectFetcher {
9018
9040
  created: !isMerge ? (/* @__PURE__ */ new Date()).toISOString() : void 0,
9019
9041
  //if we're merging/updating an event we will not add this ts
9020
9042
  metadata,
9043
+ origin,
9021
9044
  ...!!isMerge ? {
9022
9045
  [IS_MERGE_FIELD]: true
9023
9046
  } : {}
@@ -9037,6 +9060,7 @@ var Dataset2 = class extends ObjectFetcher {
9037
9060
  * about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the
9038
9061
  * `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any
9039
9062
  * JSON-serializable type, but its keys must be strings.
9063
+ * @param event.origin (Optional) a reference to the source object this dataset record was derived from.
9040
9064
  * @param event.id (Optional) a unique identifier for the event. If you don't provide one, Braintrust will generate one for you.
9041
9065
  * @param event.output: (Deprecated) The output of your application. Use `expected` instead.
9042
9066
  * @returns The `id` of the logged record.
@@ -9047,7 +9071,8 @@ var Dataset2 = class extends ObjectFetcher {
9047
9071
  metadata,
9048
9072
  tags,
9049
9073
  id,
9050
- output
9074
+ output,
9075
+ origin
9051
9076
  }) {
9052
9077
  this.validateEvent({ metadata, expected, output, tags });
9053
9078
  const rowId = id || uuidv42();
@@ -9059,6 +9084,7 @@ var Dataset2 = class extends ObjectFetcher {
9059
9084
  metadata,
9060
9085
  tags,
9061
9086
  output,
9087
+ origin,
9062
9088
  isMerge: false
9063
9089
  })
9064
9090
  );
@@ -26054,6 +26080,10 @@ function configureWorkerd() {
26054
26080
  }
26055
26081
  return process.env[name];
26056
26082
  };
26083
+ isomorph_default.getBraintrustApiKey = async () => {
26084
+ const value = isomorph_default.getEnv("BRAINTRUST_API_KEY");
26085
+ return value?.trim() ? value : void 0;
26086
+ };
26057
26087
  isomorph_default.hash = (data) => {
26058
26088
  let hash = 0;
26059
26089
  for (let i = 0; i < data.length; i++) {
@@ -26089,6 +26119,7 @@ __export(exports_exports, {
26089
26119
  DEFAULT_FETCH_BATCH_SIZE: () => DEFAULT_FETCH_BATCH_SIZE,
26090
26120
  DEFAULT_MAX_REQUEST_SIZE: () => DEFAULT_MAX_REQUEST_SIZE,
26091
26121
  Dataset: () => Dataset2,
26122
+ DatasetPipeline: () => DatasetPipeline,
26092
26123
  ERR_PERMALINK: () => ERR_PERMALINK,
26093
26124
  Eval: () => Eval,
26094
26125
  EvalResultWithSummary: () => EvalResultWithSummary,
@@ -29347,10 +29378,12 @@ function formatExperimentSummary(summary) {
29347
29378
  // src/wrappers/shared/flush.ts
29348
29379
  async function summarizeAndFlush(experiment, options) {
29349
29380
  const shouldDisplay = options.displaySummary ?? true;
29350
- const summary = await experiment.summarize();
29351
- if (shouldDisplay) {
29352
- console.log(formatExperimentSummary(summary));
29381
+ if (!shouldDisplay) {
29382
+ await experiment.flush();
29383
+ return;
29353
29384
  }
29385
+ const summary = await experiment.summarize();
29386
+ console.log(formatExperimentSummary(summary));
29354
29387
  }
29355
29388
 
29356
29389
  // src/wrappers/vitest/flush-manager.ts
@@ -31214,8 +31247,12 @@ var waterfall$1 = awaitify(waterfall);
31214
31247
 
31215
31248
  // src/trace.ts
31216
31249
  var SpanFetcher = class _SpanFetcher extends ObjectFetcher {
31217
- constructor(objectType, _objectId, rootSpanId, _state, spanTypeFilter) {
31218
- const filterExpr = _SpanFetcher.buildFilter(rootSpanId, spanTypeFilter);
31250
+ constructor(objectType, _objectId, rootSpanId, _state, spanTypeFilter, includeScorers = false) {
31251
+ const filterExpr = _SpanFetcher.buildFilter(
31252
+ rootSpanId,
31253
+ spanTypeFilter,
31254
+ includeScorers
31255
+ );
31219
31256
  super(objectType, void 0, void 0, {
31220
31257
  filter: filterExpr
31221
31258
  });
@@ -31224,16 +31261,17 @@ var SpanFetcher = class _SpanFetcher extends ObjectFetcher {
31224
31261
  this._state = _state;
31225
31262
  this.spanTypeFilter = spanTypeFilter;
31226
31263
  }
31227
- static buildFilter(rootSpanId, spanTypeFilter) {
31264
+ static buildFilter(rootSpanId, spanTypeFilter, includeScorers = false) {
31228
31265
  const children = [
31229
31266
  // Base filter: root_span_id = 'value'
31230
31267
  {
31231
31268
  op: "eq",
31232
31269
  left: { op: "ident", name: ["root_span_id"] },
31233
31270
  right: { op: "literal", value: rootSpanId }
31234
- },
31235
- // Exclude span_attributes.purpose = 'score'
31236
- {
31271
+ }
31272
+ ];
31273
+ if (!includeScorers) {
31274
+ children.push({
31237
31275
  op: "or",
31238
31276
  children: [
31239
31277
  {
@@ -31246,8 +31284,8 @@ var SpanFetcher = class _SpanFetcher extends ObjectFetcher {
31246
31284
  right: { op: "literal", value: "scorer" }
31247
31285
  }
31248
31286
  ]
31249
- }
31250
- ];
31287
+ });
31288
+ }
31251
31289
  if (spanTypeFilter && spanTypeFilter.length > 0) {
31252
31290
  children.push({
31253
31291
  op: "in",
@@ -31273,35 +31311,49 @@ var CachedSpanFetcher = class {
31273
31311
  fetchFn;
31274
31312
  constructor(objectTypeOrFetchFn, objectId, rootSpanId, getState) {
31275
31313
  if (typeof objectTypeOrFetchFn === "function") {
31276
- this.fetchFn = objectTypeOrFetchFn;
31314
+ this.fetchFn = (spanType) => objectTypeOrFetchFn(spanType);
31277
31315
  } else {
31278
31316
  const objectType = objectTypeOrFetchFn;
31279
- this.fetchFn = async (spanType) => {
31317
+ this.fetchFn = async (spanType, includeScorers) => {
31280
31318
  const state = await getState();
31281
31319
  const fetcher = new SpanFetcher(
31282
31320
  objectType,
31283
31321
  objectId,
31284
31322
  rootSpanId,
31285
31323
  state,
31286
- spanType
31324
+ spanType,
31325
+ includeScorers
31287
31326
  );
31288
31327
  const rows = await fetcher.fetchedData();
31289
- return rows.filter((row) => row.span_attributes?.purpose !== "scorer").map((row) => ({
31328
+ return rows.map((row) => ({
31290
31329
  input: row.input,
31291
31330
  output: row.output,
31331
+ expected: row.expected,
31332
+ error: row.error,
31333
+ scores: row.scores,
31334
+ metrics: row.metrics,
31292
31335
  metadata: row.metadata,
31293
31336
  span_id: row.span_id,
31294
31337
  span_parents: row.span_parents,
31338
+ is_root: row.is_root,
31295
31339
  span_attributes: row.span_attributes,
31296
31340
  id: row.id,
31297
31341
  _xact_id: row._xact_id,
31298
31342
  _pagination_key: row._pagination_key,
31299
- root_span_id: row.root_span_id
31343
+ root_span_id: row.root_span_id,
31344
+ created: row.created,
31345
+ tags: row.tags
31300
31346
  }));
31301
31347
  };
31302
31348
  }
31303
31349
  }
31304
- async getSpans({ spanType } = {}) {
31350
+ async getSpans({
31351
+ spanType,
31352
+ includeScorers = false
31353
+ } = {}) {
31354
+ if (includeScorers) {
31355
+ return this.fetchFn(spanType, true);
31356
+ }
31305
31357
  if (this.allFetched) {
31306
31358
  return this.getFromCache(spanType);
31307
31359
  }
@@ -31318,7 +31370,7 @@ var CachedSpanFetcher = class {
31318
31370
  return this.getFromCache(spanType);
31319
31371
  }
31320
31372
  async fetchSpans(spanType) {
31321
- const spans = await this.fetchFn(spanType);
31373
+ const spans = await this.fetchFn(spanType, false);
31322
31374
  for (const span of spans) {
31323
31375
  const type = span.span_attributes?.type ?? "";
31324
31376
  const existing = this.spanCache.get(type) ?? [];
@@ -31396,10 +31448,13 @@ var LocalTrace = class {
31396
31448
  * First checks the local span cache for recently logged spans, then falls
31397
31449
  * back to CachedSpanFetcher which handles BTQL fetching and caching.
31398
31450
  */
31399
- async getSpans({ spanType } = {}) {
31451
+ async getSpans({
31452
+ spanType,
31453
+ includeScorers = false
31454
+ } = {}) {
31400
31455
  const cachedSpans = this.state.spanCache.getByRootSpanId(this.rootSpanId);
31401
31456
  if (cachedSpans && cachedSpans.length > 0) {
31402
- let spans = cachedSpans.filter(
31457
+ let spans = includeScorers ? cachedSpans : cachedSpans.filter(
31403
31458
  (span) => span.span_attributes?.purpose !== "scorer"
31404
31459
  );
31405
31460
  if (spanType && spanType.length > 0) {
@@ -31410,13 +31465,19 @@ var LocalTrace = class {
31410
31465
  return spans.map((span) => ({
31411
31466
  input: span.input,
31412
31467
  output: span.output,
31468
+ expected: span.expected,
31469
+ error: span.error,
31470
+ scores: span.scores,
31471
+ metrics: span.metrics,
31413
31472
  metadata: span.metadata,
31414
31473
  span_id: span.span_id,
31415
31474
  span_parents: span.span_parents,
31416
- span_attributes: span.span_attributes
31475
+ is_root: span.is_root,
31476
+ span_attributes: span.span_attributes,
31477
+ tags: span.tags
31417
31478
  }));
31418
31479
  }
31419
- return this.cachedFetcher.getSpans({ spanType });
31480
+ return this.cachedFetcher.getSpans({ spanType, includeScorers });
31420
31481
  }
31421
31482
  /**
31422
31483
  * Get the thread (preprocessed messages) for this trace.
@@ -32605,6 +32666,34 @@ var defaultReporter = {
32605
32666
  }
32606
32667
  };
32607
32668
 
32669
+ // src/dataset-pipeline.ts
32670
+ function DatasetPipeline(definition) {
32671
+ if (!globalThis.__braintrust_dataset_pipelines) {
32672
+ globalThis.__braintrust_dataset_pipelines = [];
32673
+ }
32674
+ const storedDefinition = {
32675
+ name: definition.name,
32676
+ source: {
32677
+ projectId: definition.source.projectId,
32678
+ projectName: definition.source.projectName,
32679
+ orgName: definition.source.orgName,
32680
+ filter: definition.source.filter,
32681
+ scope: definition.source.scope ?? "span"
32682
+ },
32683
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions, @typescript-eslint/no-explicit-any
32684
+ transform: definition.transform,
32685
+ target: {
32686
+ projectId: definition.target.projectId,
32687
+ projectName: definition.target.projectName,
32688
+ orgName: definition.target.orgName,
32689
+ datasetName: definition.target.datasetName,
32690
+ description: definition.target.description,
32691
+ metadata: definition.target.metadata
32692
+ }
32693
+ };
32694
+ globalThis.__braintrust_dataset_pipelines.push(storedDefinition);
32695
+ }
32696
+
32608
32697
  // src/framework2.ts
32609
32698
  import { z as z12 } from "zod/v3";
32610
32699
  var currentFilename = typeof __filename !== "undefined" ? __filename : "unknown";
@@ -33144,6 +33233,7 @@ export {
33144
33233
  DEFAULT_FETCH_BATCH_SIZE,
33145
33234
  DEFAULT_MAX_REQUEST_SIZE,
33146
33235
  Dataset2 as Dataset,
33236
+ DatasetPipeline,
33147
33237
  ERR_PERMALINK,
33148
33238
  Eval,
33149
33239
  EvalResultWithSummary,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braintrust",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "SDK for integrating Braintrust",
5
5
  "repository": {
6
6
  "type": "git",
@@ -138,29 +138,16 @@
138
138
  "test": "vitest run --exclude \"src/wrappers/**/*.test.ts\" --exclude \"src/otel/**/*.test.ts\" --exclude \"smoke/**/*.test.ts\" --exclude \"src/zod/**/*.test.ts\" --exclude \"tests/api-compatibility/**\"",
139
139
  "test:core": "pnpm prune && pnpm test",
140
140
  "test:checks": "pnpm run test:core && pnpm run test:vitest",
141
- "test:external": "pnpm run test:external:sequential && node scripts/run-parallel.mjs test:external:ai-sdk-v5 test:external:ai-sdk-v6 test:external:claude-agent-sdk",
142
- "test:external:sequential": "pnpm run test:external:openai && pnpm run test:external:anthropic && pnpm run test:external:google-genai",
143
- "test:external:openai": "bash scripts/test-provider.sh test:openai openai",
144
- "test:external:anthropic": "bash scripts/test-provider.sh test:anthropic @anthropic-ai/sdk",
145
- "test:external:google-genai": "bash scripts/test-provider.sh test:google-genai @google/genai",
146
- "test:external:ai-sdk": "pnpm run test:external:ai-sdk-v5 && pnpm run test:external:ai-sdk-v6",
147
- "test:external:ai-sdk-v5": "cd src/wrappers/ai-sdk/tests/v5 && pnpm install --ignore-workspace && pnpm test",
148
- "test:external:ai-sdk-v6": "cd src/wrappers/ai-sdk/tests/v6 && pnpm install --ignore-workspace && pnpm test",
149
- "test:external:claude-agent-sdk": "cd src/wrappers/claude-agent-sdk && pnpm install && pnpm test",
150
- "test:all": "pnpm run test:checks && pnpm run test:external",
141
+ "test:all": "pnpm run test:checks",
151
142
  "test:api-compat": "vitest run tests/api-compatibility/api-compatibility.test.ts",
152
- "test:anthropic": "vitest run src/wrappers/anthropic.test.ts",
153
- "test:openai": "vitest run src/wrappers/oai.test.ts",
154
143
  "test:otel": "vitest run --dir src/otel",
155
144
  "test:otel-no-deps": "vitest run src/otel/otel-no-deps.test.ts --reporter=verbose",
156
- "test:google-genai": "vitest run src/wrappers/google-genai.test.ts",
157
145
  "test:ai-sdk-v1": "vitest run src/wrappers/ai-sdk-v1.test.ts",
158
146
  "test:ai-sdk-v2": "vitest run src/wrappers/ai-sdk-v2.test.ts src/wrappers/ai-sdk-v1.test.ts",
159
147
  "test:ai-sdk-v3": "vitest run src/wrappers/ai-sdk-v3.test.ts",
160
148
  "test:zod-v3": "vitest run src/zod/zod-v3-serialization.test.ts",
161
149
  "test:zod-v4": "vitest run src/zod/zod-v4-serialization.test.ts",
162
150
  "test:mastra": "vitest run src/wrappers/mastra.test.ts",
163
- "test:claude-agent-sdk": "pnpm --filter @braintrust/claude-agent-sdk-tests test",
164
151
  "test:vitest": "pnpm --filter @braintrust/vitest-wrapper-tests test",
165
152
  "test:output": "tsx scripts/test-output.ts --with-comparison --with-metrics --with-progress",
166
153
  "bench": "tsx src/queue.bench.ts",
@@ -191,7 +178,6 @@
191
178
  "@types/node": "^20.10.5",
192
179
  "@types/pluralize": "^0.0.30",
193
180
  "@types/tar": "^6.1.13",
194
- "@types/uuid": "^9.0.7",
195
181
  "@typescript-eslint/eslint-plugin": "^8.49.0",
196
182
  "@typescript-eslint/parser": "^8.49.0",
197
183
  "ai": "^6.0.0",
@@ -238,7 +224,7 @@
238
224
  "source-map": "^0.7.4",
239
225
  "termi-link": "^1.0.1",
240
226
  "unplugin": "^2.3.5",
241
- "uuid": "^9.0.1",
227
+ "uuid": "^11.1.1",
242
228
  "zod-to-json-schema": "^3.25.0"
243
229
  },
244
230
  "peerDependencies": {
@@ -4842,6 +4842,7 @@ declare const ObjectReference: z.ZodObject<{
4842
4842
  _xact_id?: string | null | undefined;
4843
4843
  created?: string | null | undefined;
4844
4844
  }>;
4845
+ type ObjectReferenceType = z.infer<typeof ObjectReference>;
4845
4846
 
4846
4847
  type IdField = {
4847
4848
  id: string;
@@ -4862,7 +4863,7 @@ type OtherExperimentLogFields = {
4862
4863
  metadata: Record<string, unknown>;
4863
4864
  metrics: Record<string, unknown>;
4864
4865
  datasetRecordId: string;
4865
- origin: z.infer<typeof ObjectReference>;
4866
+ origin: ObjectReferenceType;
4866
4867
  span_attributes: Record<string, unknown>;
4867
4868
  [ASYNC_SCORING_CONTROL_FIELD]: AsyncScoringControlType;
4868
4869
  [MERGE_PATHS_FIELD]: string[][];
@@ -4916,6 +4917,7 @@ type DatasetEvent = {
4916
4917
  tags?: string[];
4917
4918
  metadata?: unknown;
4918
4919
  created?: string;
4920
+ origin?: ObjectReferenceType;
4919
4921
  id: string;
4920
4922
  dataset_id: string;
4921
4923
  } & ({
@@ -4842,6 +4842,7 @@ declare const ObjectReference: z.ZodObject<{
4842
4842
  _xact_id?: string | null | undefined;
4843
4843
  created?: string | null | undefined;
4844
4844
  }>;
4845
+ type ObjectReferenceType = z.infer<typeof ObjectReference>;
4845
4846
 
4846
4847
  type IdField = {
4847
4848
  id: string;
@@ -4862,7 +4863,7 @@ type OtherExperimentLogFields = {
4862
4863
  metadata: Record<string, unknown>;
4863
4864
  metrics: Record<string, unknown>;
4864
4865
  datasetRecordId: string;
4865
- origin: z.infer<typeof ObjectReference>;
4866
+ origin: ObjectReferenceType;
4866
4867
  span_attributes: Record<string, unknown>;
4867
4868
  [ASYNC_SCORING_CONTROL_FIELD]: AsyncScoringControlType;
4868
4869
  [MERGE_PATHS_FIELD]: string[][];
@@ -4916,6 +4917,7 @@ type DatasetEvent = {
4916
4917
  tags?: string[];
4917
4918
  metadata?: unknown;
4918
4919
  created?: string;
4920
+ origin?: ObjectReferenceType;
4919
4921
  id: string;
4920
4922
  dataset_id: string;
4921
4923
  } & ({