braintrust 0.1.1 → 0.2.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 (32) hide show
  1. package/dev/dist/index.d.mts +26 -24
  2. package/dev/dist/index.d.ts +26 -24
  3. package/dev/dist/index.js +17 -10
  4. package/dev/dist/index.mjs +17 -10
  5. package/dist/browser.d.mts +77 -75
  6. package/dist/browser.d.ts +77 -75
  7. package/dist/{chunk-WEZHHYVU.js → chunk-CDBUTZMH.js} +94 -94
  8. package/dist/chunk-NB5AEJPK.mjs +19 -0
  9. package/dist/{chunk-K3GLD6I7.js → chunk-VKR7HDRS.js} +4 -4
  10. package/dist/{chunk-64O3VXT4.mjs → chunk-WKBXJQ57.mjs} +94 -94
  11. package/dist/cli.js +74 -67
  12. package/dist/getMachineId-bsd-7YM2UMB4.js +37 -0
  13. package/dist/{getMachineId-bsd-232NBLGZ.mjs → getMachineId-bsd-L7QQYES7.mjs} +4 -4
  14. package/dist/getMachineId-darwin-QV3NVG7H.js +37 -0
  15. package/dist/{getMachineId-darwin-C7F2HXMI.mjs → getMachineId-darwin-YXDFFCXM.mjs} +4 -4
  16. package/dist/getMachineId-linux-HKJ2YLJC.js +29 -0
  17. package/dist/{getMachineId-linux-VLB6DDHP.mjs → getMachineId-linux-LWEEVKPU.mjs} +3 -3
  18. package/dist/getMachineId-unsupported-EGJSIDYQ.mjs +20 -0
  19. package/dist/getMachineId-unsupported-TX34Q66M.js +20 -0
  20. package/dist/{getMachineId-win-4OSXYWMY.js → getMachineId-win-M5YW2KGK.js} +9 -9
  21. package/dist/{getMachineId-win-U7W7AAJX.mjs → getMachineId-win-UDA4B6X2.mjs} +4 -4
  22. package/dist/index.d.mts +164 -97
  23. package/dist/index.d.ts +164 -97
  24. package/dist/index.js +533 -443
  25. package/dist/index.mjs +360 -270
  26. package/package.json +3 -3
  27. package/dist/chunk-C527YOOG.mjs +0 -19
  28. package/dist/getMachineId-bsd-BCB626OV.js +0 -37
  29. package/dist/getMachineId-darwin-TV4MHNE6.js +0 -37
  30. package/dist/getMachineId-linux-RTVYWQL7.js +0 -29
  31. package/dist/getMachineId-unsupported-7RHYOLDR.js +0 -20
  32. package/dist/getMachineId-unsupported-IF5IGKUD.mjs +0 -20
@@ -191,8 +191,6 @@ declare class LazyValue<T> {
191
191
  get hasSucceeded(): boolean;
192
192
  }
193
193
 
194
- /// <reference lib="dom" />
195
-
196
194
  type SetCurrentArg = {
197
195
  setCurrent?: boolean;
198
196
  };
@@ -384,10 +382,10 @@ declare const loginSchema: z.ZodObject<{
384
382
  fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["dirty", "tag", "commit", "branch", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
385
383
  }, "strict", z.ZodTypeAny, {
386
384
  collect: "some" | "none" | "all";
387
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
385
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
388
386
  }, {
389
387
  collect: "some" | "none" | "all";
390
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
388
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
391
389
  }>>>;
392
390
  }, "strict", z.ZodTypeAny, {
393
391
  appUrl: string;
@@ -399,7 +397,7 @@ declare const loginSchema: z.ZodObject<{
399
397
  orgId?: string | null | undefined;
400
398
  gitMetadataSettings?: {
401
399
  collect: "some" | "none" | "all";
402
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
400
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
403
401
  } | null | undefined;
404
402
  }, {
405
403
  appUrl: string;
@@ -411,7 +409,7 @@ declare const loginSchema: z.ZodObject<{
411
409
  orgId?: string | null | undefined;
412
410
  gitMetadataSettings?: {
413
411
  collect: "some" | "none" | "all";
414
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
412
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
415
413
  } | null | undefined;
416
414
  }>;
417
415
  type SerializedBraintrustState = z.infer<typeof loginSchema>;
@@ -1270,23 +1268,23 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1270
1268
  detail: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"low">, z.ZodLiteral<"high">]>>;
1271
1269
  }, "strip", z.ZodTypeAny, {
1272
1270
  url: string;
1273
- detail?: "auto" | "high" | "low" | undefined;
1271
+ detail?: "auto" | "low" | "high" | undefined;
1274
1272
  }, {
1275
1273
  url?: unknown;
1276
- detail?: "auto" | "high" | "low" | undefined;
1274
+ detail?: "auto" | "low" | "high" | undefined;
1277
1275
  }>;
1278
1276
  type: z.ZodLiteral<"image_url">;
1279
1277
  }, "strip", z.ZodTypeAny, {
1280
1278
  type: "image_url";
1281
1279
  image_url: {
1282
1280
  url: string;
1283
- detail?: "auto" | "high" | "low" | undefined;
1281
+ detail?: "auto" | "low" | "high" | undefined;
1284
1282
  };
1285
1283
  }, {
1286
1284
  type: "image_url";
1287
1285
  image_url: {
1288
1286
  url?: unknown;
1289
- detail?: "auto" | "high" | "low" | undefined;
1287
+ detail?: "auto" | "low" | "high" | undefined;
1290
1288
  };
1291
1289
  }>]>, "many">]>;
1292
1290
  role: z.ZodLiteral<"user">;
@@ -1302,7 +1300,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1302
1300
  type: "image_url";
1303
1301
  image_url: {
1304
1302
  url: string;
1305
- detail?: "auto" | "high" | "low" | undefined;
1303
+ detail?: "auto" | "low" | "high" | undefined;
1306
1304
  };
1307
1305
  })[];
1308
1306
  role: "user";
@@ -1320,7 +1318,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1320
1318
  type: "image_url";
1321
1319
  image_url: {
1322
1320
  url?: unknown;
1323
- detail?: "auto" | "high" | "low" | undefined;
1321
+ detail?: "auto" | "low" | "high" | undefined;
1324
1322
  };
1325
1323
  })[] | undefined;
1326
1324
  }>, z.ZodObject<{
@@ -1611,7 +1609,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1611
1609
  type: "image_url";
1612
1610
  image_url: {
1613
1611
  url: string;
1614
- detail?: "auto" | "high" | "low" | undefined;
1612
+ detail?: "auto" | "low" | "high" | undefined;
1615
1613
  };
1616
1614
  })[];
1617
1615
  role: "user";
@@ -1694,7 +1692,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1694
1692
  type: "image_url";
1695
1693
  image_url: {
1696
1694
  url?: unknown;
1697
- detail?: "auto" | "high" | "low" | undefined;
1695
+ detail?: "auto" | "low" | "high" | undefined;
1698
1696
  };
1699
1697
  })[] | undefined;
1700
1698
  } | {
@@ -2417,23 +2415,23 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2417
2415
  detail: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"low">, z.ZodLiteral<"high">]>>;
2418
2416
  }, "strip", z.ZodTypeAny, {
2419
2417
  url: string;
2420
- detail?: "auto" | "high" | "low" | undefined;
2418
+ detail?: "auto" | "low" | "high" | undefined;
2421
2419
  }, {
2422
2420
  url?: unknown;
2423
- detail?: "auto" | "high" | "low" | undefined;
2421
+ detail?: "auto" | "low" | "high" | undefined;
2424
2422
  }>;
2425
2423
  type: z.ZodLiteral<"image_url">;
2426
2424
  }, "strip", z.ZodTypeAny, {
2427
2425
  type: "image_url";
2428
2426
  image_url: {
2429
2427
  url: string;
2430
- detail?: "auto" | "high" | "low" | undefined;
2428
+ detail?: "auto" | "low" | "high" | undefined;
2431
2429
  };
2432
2430
  }, {
2433
2431
  type: "image_url";
2434
2432
  image_url: {
2435
2433
  url?: unknown;
2436
- detail?: "auto" | "high" | "low" | undefined;
2434
+ detail?: "auto" | "low" | "high" | undefined;
2437
2435
  };
2438
2436
  }>]>, "many">]>;
2439
2437
  role: z.ZodLiteral<"user">;
@@ -2449,7 +2447,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2449
2447
  type: "image_url";
2450
2448
  image_url: {
2451
2449
  url: string;
2452
- detail?: "auto" | "high" | "low" | undefined;
2450
+ detail?: "auto" | "low" | "high" | undefined;
2453
2451
  };
2454
2452
  })[];
2455
2453
  role: "user";
@@ -2467,7 +2465,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2467
2465
  type: "image_url";
2468
2466
  image_url: {
2469
2467
  url?: unknown;
2470
- detail?: "auto" | "high" | "low" | undefined;
2468
+ detail?: "auto" | "low" | "high" | undefined;
2471
2469
  };
2472
2470
  })[] | undefined;
2473
2471
  }>, z.ZodObject<{
@@ -2758,7 +2756,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2758
2756
  type: "image_url";
2759
2757
  image_url: {
2760
2758
  url: string;
2761
- detail?: "auto" | "high" | "low" | undefined;
2759
+ detail?: "auto" | "low" | "high" | undefined;
2762
2760
  };
2763
2761
  })[];
2764
2762
  role: "user";
@@ -2841,7 +2839,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2841
2839
  type: "image_url";
2842
2840
  image_url: {
2843
2841
  url?: unknown;
2844
- detail?: "auto" | "high" | "low" | undefined;
2842
+ detail?: "auto" | "low" | "high" | undefined;
2845
2843
  };
2846
2844
  })[] | undefined;
2847
2845
  } | {
@@ -3536,7 +3534,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
3536
3534
  type: "image_url";
3537
3535
  image_url: {
3538
3536
  url: string;
3539
- detail?: "auto" | "high" | "low" | undefined;
3537
+ detail?: "auto" | "low" | "high" | undefined;
3540
3538
  };
3541
3539
  })[];
3542
3540
  role: "user";
@@ -3747,7 +3745,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
3747
3745
  type: "image_url";
3748
3746
  image_url: {
3749
3747
  url?: unknown;
3750
- detail?: "auto" | "high" | "low" | undefined;
3748
+ detail?: "auto" | "low" | "high" | undefined;
3751
3749
  };
3752
3750
  })[] | undefined;
3753
3751
  } | {
@@ -3984,6 +3982,10 @@ interface EvalHooks<Expected, Metadata extends BaseMetadata, Parameters extends
3984
3982
  * Report progress that will show up in the playground.
3985
3983
  */
3986
3984
  reportProgress: (progress: TaskProgressEvent) => void;
3985
+ /**
3986
+ * The index of the current trial (0-based). This is useful when trialCount > 1.
3987
+ */
3988
+ trialIndex: number;
3987
3989
  }
3988
3990
  type EvalScorerArgs<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalCase<Input, Expected, Metadata> & {
3989
3991
  output: Output;
@@ -191,8 +191,6 @@ declare class LazyValue<T> {
191
191
  get hasSucceeded(): boolean;
192
192
  }
193
193
 
194
- /// <reference lib="dom" />
195
-
196
194
  type SetCurrentArg = {
197
195
  setCurrent?: boolean;
198
196
  };
@@ -384,10 +382,10 @@ declare const loginSchema: z.ZodObject<{
384
382
  fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["dirty", "tag", "commit", "branch", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
385
383
  }, "strict", z.ZodTypeAny, {
386
384
  collect: "some" | "none" | "all";
387
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
385
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
388
386
  }, {
389
387
  collect: "some" | "none" | "all";
390
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
388
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
391
389
  }>>>;
392
390
  }, "strict", z.ZodTypeAny, {
393
391
  appUrl: string;
@@ -399,7 +397,7 @@ declare const loginSchema: z.ZodObject<{
399
397
  orgId?: string | null | undefined;
400
398
  gitMetadataSettings?: {
401
399
  collect: "some" | "none" | "all";
402
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
400
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
403
401
  } | null | undefined;
404
402
  }, {
405
403
  appUrl: string;
@@ -411,7 +409,7 @@ declare const loginSchema: z.ZodObject<{
411
409
  orgId?: string | null | undefined;
412
410
  gitMetadataSettings?: {
413
411
  collect: "some" | "none" | "all";
414
- fields?: ("branch" | "dirty" | "tag" | "commit" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
412
+ fields?: ("dirty" | "tag" | "commit" | "branch" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
415
413
  } | null | undefined;
416
414
  }>;
417
415
  type SerializedBraintrustState = z.infer<typeof loginSchema>;
@@ -1270,23 +1268,23 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1270
1268
  detail: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"low">, z.ZodLiteral<"high">]>>;
1271
1269
  }, "strip", z.ZodTypeAny, {
1272
1270
  url: string;
1273
- detail?: "auto" | "high" | "low" | undefined;
1271
+ detail?: "auto" | "low" | "high" | undefined;
1274
1272
  }, {
1275
1273
  url?: unknown;
1276
- detail?: "auto" | "high" | "low" | undefined;
1274
+ detail?: "auto" | "low" | "high" | undefined;
1277
1275
  }>;
1278
1276
  type: z.ZodLiteral<"image_url">;
1279
1277
  }, "strip", z.ZodTypeAny, {
1280
1278
  type: "image_url";
1281
1279
  image_url: {
1282
1280
  url: string;
1283
- detail?: "auto" | "high" | "low" | undefined;
1281
+ detail?: "auto" | "low" | "high" | undefined;
1284
1282
  };
1285
1283
  }, {
1286
1284
  type: "image_url";
1287
1285
  image_url: {
1288
1286
  url?: unknown;
1289
- detail?: "auto" | "high" | "low" | undefined;
1287
+ detail?: "auto" | "low" | "high" | undefined;
1290
1288
  };
1291
1289
  }>]>, "many">]>;
1292
1290
  role: z.ZodLiteral<"user">;
@@ -1302,7 +1300,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1302
1300
  type: "image_url";
1303
1301
  image_url: {
1304
1302
  url: string;
1305
- detail?: "auto" | "high" | "low" | undefined;
1303
+ detail?: "auto" | "low" | "high" | undefined;
1306
1304
  };
1307
1305
  })[];
1308
1306
  role: "user";
@@ -1320,7 +1318,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1320
1318
  type: "image_url";
1321
1319
  image_url: {
1322
1320
  url?: unknown;
1323
- detail?: "auto" | "high" | "low" | undefined;
1321
+ detail?: "auto" | "low" | "high" | undefined;
1324
1322
  };
1325
1323
  })[] | undefined;
1326
1324
  }>, z.ZodObject<{
@@ -1611,7 +1609,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1611
1609
  type: "image_url";
1612
1610
  image_url: {
1613
1611
  url: string;
1614
- detail?: "auto" | "high" | "low" | undefined;
1612
+ detail?: "auto" | "low" | "high" | undefined;
1615
1613
  };
1616
1614
  })[];
1617
1615
  role: "user";
@@ -1694,7 +1692,7 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
1694
1692
  type: "image_url";
1695
1693
  image_url: {
1696
1694
  url?: unknown;
1697
- detail?: "auto" | "high" | "low" | undefined;
1695
+ detail?: "auto" | "low" | "high" | undefined;
1698
1696
  };
1699
1697
  })[] | undefined;
1700
1698
  } | {
@@ -2417,23 +2415,23 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2417
2415
  detail: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"low">, z.ZodLiteral<"high">]>>;
2418
2416
  }, "strip", z.ZodTypeAny, {
2419
2417
  url: string;
2420
- detail?: "auto" | "high" | "low" | undefined;
2418
+ detail?: "auto" | "low" | "high" | undefined;
2421
2419
  }, {
2422
2420
  url?: unknown;
2423
- detail?: "auto" | "high" | "low" | undefined;
2421
+ detail?: "auto" | "low" | "high" | undefined;
2424
2422
  }>;
2425
2423
  type: z.ZodLiteral<"image_url">;
2426
2424
  }, "strip", z.ZodTypeAny, {
2427
2425
  type: "image_url";
2428
2426
  image_url: {
2429
2427
  url: string;
2430
- detail?: "auto" | "high" | "low" | undefined;
2428
+ detail?: "auto" | "low" | "high" | undefined;
2431
2429
  };
2432
2430
  }, {
2433
2431
  type: "image_url";
2434
2432
  image_url: {
2435
2433
  url?: unknown;
2436
- detail?: "auto" | "high" | "low" | undefined;
2434
+ detail?: "auto" | "low" | "high" | undefined;
2437
2435
  };
2438
2436
  }>]>, "many">]>;
2439
2437
  role: z.ZodLiteral<"user">;
@@ -2449,7 +2447,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2449
2447
  type: "image_url";
2450
2448
  image_url: {
2451
2449
  url: string;
2452
- detail?: "auto" | "high" | "low" | undefined;
2450
+ detail?: "auto" | "low" | "high" | undefined;
2453
2451
  };
2454
2452
  })[];
2455
2453
  role: "user";
@@ -2467,7 +2465,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2467
2465
  type: "image_url";
2468
2466
  image_url: {
2469
2467
  url?: unknown;
2470
- detail?: "auto" | "high" | "low" | undefined;
2468
+ detail?: "auto" | "low" | "high" | undefined;
2471
2469
  };
2472
2470
  })[] | undefined;
2473
2471
  }>, z.ZodObject<{
@@ -2758,7 +2756,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2758
2756
  type: "image_url";
2759
2757
  image_url: {
2760
2758
  url: string;
2761
- detail?: "auto" | "high" | "low" | undefined;
2759
+ detail?: "auto" | "low" | "high" | undefined;
2762
2760
  };
2763
2761
  })[];
2764
2762
  role: "user";
@@ -2841,7 +2839,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
2841
2839
  type: "image_url";
2842
2840
  image_url: {
2843
2841
  url?: unknown;
2844
- detail?: "auto" | "high" | "low" | undefined;
2842
+ detail?: "auto" | "low" | "high" | undefined;
2845
2843
  };
2846
2844
  })[] | undefined;
2847
2845
  } | {
@@ -3536,7 +3534,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
3536
3534
  type: "image_url";
3537
3535
  image_url: {
3538
3536
  url: string;
3539
- detail?: "auto" | "high" | "low" | undefined;
3537
+ detail?: "auto" | "low" | "high" | undefined;
3540
3538
  };
3541
3539
  })[];
3542
3540
  role: "user";
@@ -3747,7 +3745,7 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
3747
3745
  type: "image_url";
3748
3746
  image_url: {
3749
3747
  url?: unknown;
3750
- detail?: "auto" | "high" | "low" | undefined;
3748
+ detail?: "auto" | "low" | "high" | undefined;
3751
3749
  };
3752
3750
  })[] | undefined;
3753
3751
  } | {
@@ -3984,6 +3982,10 @@ interface EvalHooks<Expected, Metadata extends BaseMetadata, Parameters extends
3984
3982
  * Report progress that will show up in the playground.
3985
3983
  */
3986
3984
  reportProgress: (progress: TaskProgressEvent) => void;
3985
+ /**
3986
+ * The index of the current trial (0-based). This is useful when trialCount > 1.
3987
+ */
3988
+ trialIndex: number;
3987
3989
  }
3988
3990
  type EvalScorerArgs<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalCase<Input, Expected, Metadata> & {
3989
3991
  output: Output;
package/dev/dist/index.js CHANGED
@@ -100,7 +100,7 @@ async function getBaseBranchAncestor(remote = void 0) {
100
100
  return void 0;
101
101
  }
102
102
  }
103
- async function getPastNAncestors(n = 10, remote = void 0) {
103
+ async function getPastNAncestors(n = 1e3, remote = void 0) {
104
104
  const git = await currentRepo();
105
105
  if (git === null) {
106
106
  return [];
@@ -117,7 +117,7 @@ async function getPastNAncestors(n = 10, remote = void 0) {
117
117
  if (!ancestor) {
118
118
  return [];
119
119
  }
120
- const commits = await git.log({ from: ancestor, to: "HEAD" });
120
+ const commits = await git.log({ from: ancestor, to: "HEAD", maxCount: n });
121
121
  return commits.all.map((c) => c.hash);
122
122
  }
123
123
  async function attempt(fn) {
@@ -4441,7 +4441,7 @@ var _cors = require('cors'); var _cors2 = _interopRequireDefault(_cors);
4441
4441
  // src/framework.ts
4442
4442
 
4443
4443
 
4444
- // ../node_modules/.pnpm/async@3.2.5/node_modules/async/dist/async.mjs
4444
+ // ../../node_modules/.pnpm/async@3.2.5/node_modules/async/dist/async.mjs
4445
4445
  function initialParams(fn) {
4446
4446
  return function(...args) {
4447
4447
  var callback = args.pop();
@@ -6151,14 +6151,20 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
6151
6151
  } else {
6152
6152
  data = dataResult;
6153
6153
  }
6154
- data = data.filter((d) => filters.every((f) => evaluateFilter(d, f))).flatMap(
6155
- (datum) => [...Array(_nullishCoalesce(evaluator.trialCount, () => ( 1))).keys()].map(() => datum)
6154
+ const dataWithTrials = data.filter((d) => filters.every((f) => evaluateFilter(d, f))).flatMap(
6155
+ (datum) => [...Array(_nullishCoalesce(evaluator.trialCount, () => ( 1))).keys()].map((trialIndex) => ({
6156
+ datum,
6157
+ trialIndex
6158
+ }))
6156
6159
  );
6157
- progressReporter.start(evaluator.evalName, data.length);
6160
+ progressReporter.start(evaluator.evalName, dataWithTrials.length);
6158
6161
  const results = [];
6159
6162
  const q = queue(
6160
6163
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6161
- async (datum) => {
6164
+ async ({
6165
+ datum,
6166
+ trialIndex
6167
+ }) => {
6162
6168
  const eventDataset = experiment ? experiment.dataset : Dataset.isDataset(evaluator.data) ? evaluator.data : void 0;
6163
6169
  const baseEvent = {
6164
6170
  name: "eval",
@@ -6207,7 +6213,8 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
6207
6213
  name: evaluator.evalName,
6208
6214
  object_type: "task"
6209
6215
  })]);
6210
- }
6216
+ },
6217
+ trialIndex
6211
6218
  });
6212
6219
  if (outputResult instanceof Promise) {
6213
6220
  output = await outputResult;
@@ -6357,9 +6364,9 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
6357
6364
  return await experiment.traced(callback, baseEvent);
6358
6365
  }
6359
6366
  },
6360
- Math.max(_nullishCoalesce(evaluator.maxConcurrency, () => ( data.length)), 1)
6367
+ Math.max(_nullishCoalesce(evaluator.maxConcurrency, () => ( dataWithTrials.length)), 1)
6361
6368
  );
6362
- q.push(data);
6369
+ q.push(dataWithTrials);
6363
6370
  const cancel = async () => {
6364
6371
  await new Promise((_, reject2) => {
6365
6372
  if (evaluator.timeout) {
@@ -100,7 +100,7 @@ async function getBaseBranchAncestor(remote = void 0) {
100
100
  return void 0;
101
101
  }
102
102
  }
103
- async function getPastNAncestors(n = 10, remote = void 0) {
103
+ async function getPastNAncestors(n = 1e3, remote = void 0) {
104
104
  const git = await currentRepo();
105
105
  if (git === null) {
106
106
  return [];
@@ -117,7 +117,7 @@ async function getPastNAncestors(n = 10, remote = void 0) {
117
117
  if (!ancestor) {
118
118
  return [];
119
119
  }
120
- const commits = await git.log({ from: ancestor, to: "HEAD" });
120
+ const commits = await git.log({ from: ancestor, to: "HEAD", maxCount: n });
121
121
  return commits.all.map((c) => c.hash);
122
122
  }
123
123
  async function attempt(fn) {
@@ -4441,7 +4441,7 @@ import cors from "cors";
4441
4441
  // src/framework.ts
4442
4442
  import { SpanTypeAttribute as SpanTypeAttribute2, mergeDicts as mergeDicts2 } from "@braintrust/core";
4443
4443
 
4444
- // ../node_modules/.pnpm/async@3.2.5/node_modules/async/dist/async.mjs
4444
+ // ../../node_modules/.pnpm/async@3.2.5/node_modules/async/dist/async.mjs
4445
4445
  function initialParams(fn) {
4446
4446
  return function(...args) {
4447
4447
  var callback = args.pop();
@@ -6151,14 +6151,20 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
6151
6151
  } else {
6152
6152
  data = dataResult;
6153
6153
  }
6154
- data = data.filter((d) => filters.every((f) => evaluateFilter(d, f))).flatMap(
6155
- (datum) => [...Array(evaluator.trialCount ?? 1).keys()].map(() => datum)
6154
+ const dataWithTrials = data.filter((d) => filters.every((f) => evaluateFilter(d, f))).flatMap(
6155
+ (datum) => [...Array(evaluator.trialCount ?? 1).keys()].map((trialIndex) => ({
6156
+ datum,
6157
+ trialIndex
6158
+ }))
6156
6159
  );
6157
- progressReporter.start(evaluator.evalName, data.length);
6160
+ progressReporter.start(evaluator.evalName, dataWithTrials.length);
6158
6161
  const results = [];
6159
6162
  const q = queue(
6160
6163
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6161
- async (datum) => {
6164
+ async ({
6165
+ datum,
6166
+ trialIndex
6167
+ }) => {
6162
6168
  const eventDataset = experiment ? experiment.dataset : Dataset.isDataset(evaluator.data) ? evaluator.data : void 0;
6163
6169
  const baseEvent = {
6164
6170
  name: "eval",
@@ -6207,7 +6213,8 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
6207
6213
  name: evaluator.evalName,
6208
6214
  object_type: "task"
6209
6215
  });
6210
- }
6216
+ },
6217
+ trialIndex
6211
6218
  });
6212
6219
  if (outputResult instanceof Promise) {
6213
6220
  output = await outputResult;
@@ -6357,9 +6364,9 @@ async function runEvaluatorInternal(experiment, evaluator, progressReporter, fil
6357
6364
  return await experiment.traced(callback, baseEvent);
6358
6365
  }
6359
6366
  },
6360
- Math.max(evaluator.maxConcurrency ?? data.length, 1)
6367
+ Math.max(evaluator.maxConcurrency ?? dataWithTrials.length, 1)
6361
6368
  );
6362
- q.push(data);
6369
+ q.push(dataWithTrials);
6363
6370
  const cancel = async () => {
6364
6371
  await new Promise((_, reject2) => {
6365
6372
  if (evaluator.timeout) {