braintrust 0.1.0 → 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.
package/dist/index.d.mts CHANGED
@@ -220,7 +220,7 @@ interface Exportable {
220
220
  *
221
221
  * We suggest using one of the various `traced` methods, instead of creating Spans directly. See {@link Span.traced} for full details.
222
222
  */
223
- interface Span extends Exportable {
223
+ interface Span$1 extends Exportable {
224
224
  /**
225
225
  * Row ID of the span.
226
226
  */
@@ -264,7 +264,7 @@ interface Span extends Exportable {
264
264
  * @param args.event Data to be logged. See {@link Experiment.log} for full details.
265
265
  * @returns The result of running `callback`.
266
266
  */
267
- traced<R>(callback: (span: Span) => R, args?: StartSpanArgs & SetCurrentArg): R;
267
+ traced<R>(callback: (span: Span$1) => R, args?: StartSpanArgs & SetCurrentArg): R;
268
268
  /**
269
269
  * Lower-level alternative to `traced`. This allows you to start a span yourself, and can be useful in situations
270
270
  * where you cannot use callbacks. However, spans started with `startSpan` will not be marked as the "current span",
@@ -274,7 +274,7 @@ interface Span extends Exportable {
274
274
  *
275
275
  * @returns The newly-created `Span`
276
276
  */
277
- startSpan(args?: StartSpanArgs): Span;
277
+ startSpan(args?: StartSpanArgs): Span$1;
278
278
  /**
279
279
  * Log an end time to the span (defaults to the current time). Returns the logged time.
280
280
  *
@@ -337,14 +337,14 @@ interface Span extends Exportable {
337
337
  /**
338
338
  * Start a span with a specific id and parent span ids.
339
339
  */
340
- startSpanWithParents(spanId: string, spanParents: string[], args?: StartSpanArgs): Span;
340
+ startSpanWithParents(spanId: string, spanParents: string[], args?: StartSpanArgs): Span$1;
341
341
  state(): BraintrustState;
342
342
  kind: "span";
343
343
  }
344
344
  /**
345
345
  * A fake implementation of the Span API which does nothing. This can be used as the default span.
346
346
  */
347
- declare class NoopSpan implements Span {
347
+ declare class NoopSpan implements Span$1 {
348
348
  id: string;
349
349
  spanId: string;
350
350
  rootSpanId: string;
@@ -353,7 +353,7 @@ declare class NoopSpan implements Span {
353
353
  constructor();
354
354
  log(_: ExperimentLogPartialArgs): void;
355
355
  logFeedback(_event: Omit<LogFeedbackFullArgs, "id">): void;
356
- traced<R>(callback: (span: Span) => R, _1?: StartSpanArgs & SetCurrentArg): R;
356
+ traced<R>(callback: (span: Span$1) => R, _1?: StartSpanArgs & SetCurrentArg): R;
357
357
  startSpan(_1?: StartSpanArgs): this;
358
358
  end(args?: EndSpanArgs): number;
359
359
  export(): Promise<string>;
@@ -362,7 +362,7 @@ declare class NoopSpan implements Span {
362
362
  flush(): Promise<void>;
363
363
  close(args?: EndSpanArgs): number;
364
364
  setAttributes(_args: Omit<StartSpanArgs, "event">): void;
365
- startSpanWithParents(_spanId: string, _spanParents: string[], _args?: StartSpanArgs): Span;
365
+ startSpanWithParents(_spanId: string, _spanParents: string[], _args?: StartSpanArgs): Span$1;
366
366
  state(): BraintrustState;
367
367
  }
368
368
  declare const NOOP_SPAN: NoopSpan;
@@ -420,7 +420,7 @@ declare class BraintrustState {
420
420
  currentExperiment: Experiment | undefined;
421
421
  currentLogger: Logger<false> | undefined;
422
422
  currentParent: IsoAsyncLocalStorage<string>;
423
- currentSpan: IsoAsyncLocalStorage<Span>;
423
+ currentSpan: IsoAsyncLocalStorage<Span$1>;
424
424
  private _bgLogger;
425
425
  private _overrideBgLogger;
426
426
  appUrl: string | null;
@@ -797,7 +797,7 @@ declare class Logger<IsAsyncFlush extends boolean> implements Exportable {
797
797
  *
798
798
  * See {@link Span.traced} for full details.
799
799
  */
800
- traced<R>(callback: (span: Span) => R, args?: StartSpanArgs & SetCurrentArg): PromiseUnless<IsAsyncFlush, R>;
800
+ traced<R>(callback: (span: Span$1) => R, args?: StartSpanArgs & SetCurrentArg): PromiseUnless<IsAsyncFlush, R>;
801
801
  /**
802
802
  * Lower-level alternative to `traced`. This allows you to start a span yourself, and can be useful in situations
803
803
  * where you cannot use callbacks. However, spans started with `startSpan` will not be marked as the "current span",
@@ -805,7 +805,7 @@ declare class Logger<IsAsyncFlush extends boolean> implements Exportable {
805
805
  *
806
806
  * See {@link traced} for full details.
807
807
  */
808
- startSpan(args?: StartSpanArgs): Span;
808
+ startSpan(args?: StartSpanArgs): Span$1;
809
809
  private startSpanImpl;
810
810
  /**
811
811
  * Log feedback to an event. Feedback is used to save feedback scores, set an expected value, or add a comment.
@@ -1139,12 +1139,12 @@ declare function currentLogger<IsAsyncFlush extends boolean>(options?: AsyncFlus
1139
1139
  *
1140
1140
  * See {@link Span} for full details.
1141
1141
  */
1142
- declare function currentSpan(options?: OptionalStateArg): Span;
1142
+ declare function currentSpan(options?: OptionalStateArg): Span$1;
1143
1143
  /**
1144
1144
  * Mainly for internal use. Return the parent object for starting a span in a global context.
1145
1145
  */
1146
- declare function getSpanParentObject<IsAsyncFlush extends boolean>(options?: AsyncFlushArg<IsAsyncFlush> & OptionalStateArg): Span | Experiment | Logger<IsAsyncFlush>;
1147
- declare function logError(span: Span, error: unknown): void;
1146
+ declare function getSpanParentObject<IsAsyncFlush extends boolean>(options?: AsyncFlushArg<IsAsyncFlush> & OptionalStateArg): Span$1 | Experiment | Logger<IsAsyncFlush>;
1147
+ declare function logError(span: Span$1, error: unknown): void;
1148
1148
  /**
1149
1149
  * Toplevel function for starting a span. It checks the following (in precedence order):
1150
1150
  * * Currently-active span
@@ -1155,7 +1155,7 @@ declare function logError(span: Span, error: unknown): void;
1155
1155
  *
1156
1156
  * See {@link Span.traced} for full details.
1157
1157
  */
1158
- declare function traced<IsAsyncFlush extends boolean = true, R = void>(callback: (span: Span) => R, args?: StartSpanArgs & SetCurrentArg & AsyncFlushArg<IsAsyncFlush> & OptionalStateArg): PromiseUnless<IsAsyncFlush, R>;
1158
+ declare function traced<IsAsyncFlush extends boolean = true, R = void>(callback: (span: Span$1) => R, args?: StartSpanArgs & SetCurrentArg & AsyncFlushArg<IsAsyncFlush> & OptionalStateArg): PromiseUnless<IsAsyncFlush, R>;
1159
1159
  /**
1160
1160
  * Wrap a function with `traced`, using the arguments as `input` and return value as `output`.
1161
1161
  * Any functions wrapped this way will automatically be traced, similar to the `@traced` decorator
@@ -1194,7 +1194,7 @@ declare const traceable: typeof wrapTraced;
1194
1194
  *
1195
1195
  * See {@link traced} for full details.
1196
1196
  */
1197
- declare function startSpan<IsAsyncFlush extends boolean = true>(args?: StartSpanArgs & AsyncFlushArg<IsAsyncFlush> & OptionalStateArg): Span;
1197
+ declare function startSpan<IsAsyncFlush extends boolean = true>(args?: StartSpanArgs & AsyncFlushArg<IsAsyncFlush> & OptionalStateArg): Span$1;
1198
1198
  /**
1199
1199
  * Flush any pending rows to the server.
1200
1200
  */
@@ -1209,7 +1209,7 @@ declare function setFetch(fetch: typeof globalThis.fetch): void;
1209
1209
  /**
1210
1210
  * Runs the provided callback with the span as the current span.
1211
1211
  */
1212
- declare function withCurrent<R>(span: Span, callback: (span: Span) => R, state?: BraintrustState | undefined): R;
1212
+ declare function withCurrent<R>(span: Span$1, callback: (span: Span$1) => R, state?: BraintrustState | undefined): R;
1213
1213
  declare function withParent<R>(parent: string, callback: () => R, state?: BraintrustState | undefined): R;
1214
1214
  /**
1215
1215
  * Creates a deep copy of the given event. Replaces references to user objects
@@ -1311,7 +1311,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
1311
1311
  *
1312
1312
  * See {@link Span.traced} for full details.
1313
1313
  */
1314
- traced<R>(callback: (span: Span) => R, args?: StartSpanArgs & SetCurrentArg): R;
1314
+ traced<R>(callback: (span: Span$1) => R, args?: StartSpanArgs & SetCurrentArg): R;
1315
1315
  /**
1316
1316
  * Lower-level alternative to `traced`. This allows you to start a span yourself, and can be useful in situations
1317
1317
  * where you cannot use callbacks. However, spans started with `startSpan` will not be marked as the "current span",
@@ -1319,7 +1319,7 @@ declare class Experiment extends ObjectFetcher<ExperimentEvent> implements Expor
1319
1319
  *
1320
1320
  * See {@link traced} for full details.
1321
1321
  */
1322
- startSpan(args?: StartSpanArgs): Span;
1322
+ startSpan(args?: StartSpanArgs): Span$1;
1323
1323
  private startSpanImpl;
1324
1324
  fetchBaseExperiment(): Promise<{
1325
1325
  id: any;
@@ -1389,7 +1389,7 @@ declare function newId(): string;
1389
1389
  *
1390
1390
  * We suggest using one of the various `traced` methods, instead of creating Spans directly. See {@link Span.startSpan} for full details.
1391
1391
  */
1392
- declare class SpanImpl implements Span {
1392
+ declare class SpanImpl implements Span$1 {
1393
1393
  private _state;
1394
1394
  private isMerge;
1395
1395
  private loggedEndTime;
@@ -1420,9 +1420,9 @@ declare class SpanImpl implements Span {
1420
1420
  log(event: ExperimentLogPartialArgs): void;
1421
1421
  private logInternal;
1422
1422
  logFeedback(event: Omit<LogFeedbackFullArgs, "id">): void;
1423
- traced<R>(callback: (span: Span) => R, args?: StartSpanArgs & SetCurrentArg): R;
1424
- startSpan(args?: StartSpanArgs): Span;
1425
- startSpanWithParents(spanId: string, spanParents: string[], args?: StartSpanArgs): Span;
1423
+ traced<R>(callback: (span: Span$1) => R, args?: StartSpanArgs & SetCurrentArg): R;
1424
+ startSpan(args?: StartSpanArgs): Span$1;
1425
+ startSpanWithParents(spanId: string, spanParents: string[], args?: StartSpanArgs): Span$1;
1426
1426
  end(args?: EndSpanArgs): number;
1427
1427
  export(): Promise<string>;
1428
1428
  permalink(): Promise<string>;
@@ -2555,6 +2555,52 @@ declare const promptContentsSchema: z.ZodUnion<[z.ZodObject<{
2555
2555
  name: string;
2556
2556
  content: string | null;
2557
2557
  role: "function";
2558
+ }>, z.ZodObject<{
2559
+ content: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodArray<z.ZodObject<{
2560
+ text: z.ZodDefault<z.ZodString>;
2561
+ type: z.ZodLiteral<"text">;
2562
+ cache_control: z.ZodOptional<z.ZodObject<{
2563
+ type: z.ZodEnum<["ephemeral"]>;
2564
+ }, "strip", z.ZodTypeAny, {
2565
+ type: "ephemeral";
2566
+ }, {
2567
+ type: "ephemeral";
2568
+ }>>;
2569
+ }, "strip", z.ZodTypeAny, {
2570
+ type: "text";
2571
+ text: string;
2572
+ cache_control?: {
2573
+ type: "ephemeral";
2574
+ } | undefined;
2575
+ }, {
2576
+ type: "text";
2577
+ text?: string | undefined;
2578
+ cache_control?: {
2579
+ type: "ephemeral";
2580
+ } | undefined;
2581
+ }>, "many">]>;
2582
+ role: z.ZodLiteral<"developer">;
2583
+ name: z.ZodOptional<z.ZodString>;
2584
+ }, "strip", z.ZodTypeAny, {
2585
+ content: string | {
2586
+ type: "text";
2587
+ text: string;
2588
+ cache_control?: {
2589
+ type: "ephemeral";
2590
+ } | undefined;
2591
+ }[];
2592
+ role: "developer";
2593
+ name?: string | undefined;
2594
+ }, {
2595
+ role: "developer";
2596
+ name?: string | undefined;
2597
+ content?: string | {
2598
+ type: "text";
2599
+ text?: string | undefined;
2600
+ cache_control?: {
2601
+ type: "ephemeral";
2602
+ } | undefined;
2603
+ }[] | undefined;
2558
2604
  }>]>, z.ZodObject<{
2559
2605
  role: z.ZodEnum<["model"]>;
2560
2606
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -2632,6 +2678,16 @@ declare const promptContentsSchema: z.ZodUnion<[z.ZodObject<{
2632
2678
  name: string;
2633
2679
  content: string | null;
2634
2680
  role: "function";
2681
+ } | {
2682
+ content: string | {
2683
+ type: "text";
2684
+ text: string;
2685
+ cache_control?: {
2686
+ type: "ephemeral";
2687
+ } | undefined;
2688
+ }[];
2689
+ role: "developer";
2690
+ name?: string | undefined;
2635
2691
  } | {
2636
2692
  role: "model";
2637
2693
  content?: string | null | undefined;
@@ -2703,6 +2759,16 @@ declare const promptContentsSchema: z.ZodUnion<[z.ZodObject<{
2703
2759
  name: string;
2704
2760
  content: string | null;
2705
2761
  role: "function";
2762
+ } | {
2763
+ role: "developer";
2764
+ name?: string | undefined;
2765
+ content?: string | {
2766
+ type: "text";
2767
+ text?: string | undefined;
2768
+ cache_control?: {
2769
+ type: "ephemeral";
2770
+ } | undefined;
2771
+ }[] | undefined;
2706
2772
  } | {
2707
2773
  role: "model";
2708
2774
  content?: string | null | undefined;
@@ -3054,6 +3120,52 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
3054
3120
  name: string;
3055
3121
  content: string | null;
3056
3122
  role: "function";
3123
+ }>, z.ZodObject<{
3124
+ content: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodArray<z.ZodObject<{
3125
+ text: z.ZodDefault<z.ZodString>;
3126
+ type: z.ZodLiteral<"text">;
3127
+ cache_control: z.ZodOptional<z.ZodObject<{
3128
+ type: z.ZodEnum<["ephemeral"]>;
3129
+ }, "strip", z.ZodTypeAny, {
3130
+ type: "ephemeral";
3131
+ }, {
3132
+ type: "ephemeral";
3133
+ }>>;
3134
+ }, "strip", z.ZodTypeAny, {
3135
+ type: "text";
3136
+ text: string;
3137
+ cache_control?: {
3138
+ type: "ephemeral";
3139
+ } | undefined;
3140
+ }, {
3141
+ type: "text";
3142
+ text?: string | undefined;
3143
+ cache_control?: {
3144
+ type: "ephemeral";
3145
+ } | undefined;
3146
+ }>, "many">]>;
3147
+ role: z.ZodLiteral<"developer">;
3148
+ name: z.ZodOptional<z.ZodString>;
3149
+ }, "strip", z.ZodTypeAny, {
3150
+ content: string | {
3151
+ type: "text";
3152
+ text: string;
3153
+ cache_control?: {
3154
+ type: "ephemeral";
3155
+ } | undefined;
3156
+ }[];
3157
+ role: "developer";
3158
+ name?: string | undefined;
3159
+ }, {
3160
+ role: "developer";
3161
+ name?: string | undefined;
3162
+ content?: string | {
3163
+ type: "text";
3164
+ text?: string | undefined;
3165
+ cache_control?: {
3166
+ type: "ephemeral";
3167
+ } | undefined;
3168
+ }[] | undefined;
3057
3169
  }>]>, z.ZodObject<{
3058
3170
  role: z.ZodEnum<["model"]>;
3059
3171
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -3131,6 +3243,16 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
3131
3243
  name: string;
3132
3244
  content: string | null;
3133
3245
  role: "function";
3246
+ } | {
3247
+ content: string | {
3248
+ type: "text";
3249
+ text: string;
3250
+ cache_control?: {
3251
+ type: "ephemeral";
3252
+ } | undefined;
3253
+ }[];
3254
+ role: "developer";
3255
+ name?: string | undefined;
3134
3256
  } | {
3135
3257
  role: "model";
3136
3258
  content?: string | null | undefined;
@@ -3202,6 +3324,16 @@ declare const promptDefinitionSchema: z.ZodIntersection<z.ZodUnion<[z.ZodObject<
3202
3324
  name: string;
3203
3325
  content: string | null;
3204
3326
  role: "function";
3327
+ } | {
3328
+ role: "developer";
3329
+ name?: string | undefined;
3330
+ content?: string | {
3331
+ type: "text";
3332
+ text?: string | undefined;
3333
+ cache_control?: {
3334
+ type: "ephemeral";
3335
+ } | undefined;
3336
+ }[] | undefined;
3205
3337
  } | {
3206
3338
  role: "model";
3207
3339
  content?: string | null | undefined;
@@ -4107,6 +4239,52 @@ declare const promptDefinitionWithToolsSchema: z.ZodIntersection<z.ZodIntersecti
4107
4239
  name: string;
4108
4240
  content: string | null;
4109
4241
  role: "function";
4242
+ }>, z.ZodObject<{
4243
+ content: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodArray<z.ZodObject<{
4244
+ text: z.ZodDefault<z.ZodString>;
4245
+ type: z.ZodLiteral<"text">;
4246
+ cache_control: z.ZodOptional<z.ZodObject<{
4247
+ type: z.ZodEnum<["ephemeral"]>;
4248
+ }, "strip", z.ZodTypeAny, {
4249
+ type: "ephemeral";
4250
+ }, {
4251
+ type: "ephemeral";
4252
+ }>>;
4253
+ }, "strip", z.ZodTypeAny, {
4254
+ type: "text";
4255
+ text: string;
4256
+ cache_control?: {
4257
+ type: "ephemeral";
4258
+ } | undefined;
4259
+ }, {
4260
+ type: "text";
4261
+ text?: string | undefined;
4262
+ cache_control?: {
4263
+ type: "ephemeral";
4264
+ } | undefined;
4265
+ }>, "many">]>;
4266
+ role: z.ZodLiteral<"developer">;
4267
+ name: z.ZodOptional<z.ZodString>;
4268
+ }, "strip", z.ZodTypeAny, {
4269
+ content: string | {
4270
+ type: "text";
4271
+ text: string;
4272
+ cache_control?: {
4273
+ type: "ephemeral";
4274
+ } | undefined;
4275
+ }[];
4276
+ role: "developer";
4277
+ name?: string | undefined;
4278
+ }, {
4279
+ role: "developer";
4280
+ name?: string | undefined;
4281
+ content?: string | {
4282
+ type: "text";
4283
+ text?: string | undefined;
4284
+ cache_control?: {
4285
+ type: "ephemeral";
4286
+ } | undefined;
4287
+ }[] | undefined;
4110
4288
  }>]>, z.ZodObject<{
4111
4289
  role: z.ZodEnum<["model"]>;
4112
4290
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -4184,6 +4362,16 @@ declare const promptDefinitionWithToolsSchema: z.ZodIntersection<z.ZodIntersecti
4184
4362
  name: string;
4185
4363
  content: string | null;
4186
4364
  role: "function";
4365
+ } | {
4366
+ content: string | {
4367
+ type: "text";
4368
+ text: string;
4369
+ cache_control?: {
4370
+ type: "ephemeral";
4371
+ } | undefined;
4372
+ }[];
4373
+ role: "developer";
4374
+ name?: string | undefined;
4187
4375
  } | {
4188
4376
  role: "model";
4189
4377
  content?: string | null | undefined;
@@ -4255,6 +4443,16 @@ declare const promptDefinitionWithToolsSchema: z.ZodIntersection<z.ZodIntersecti
4255
4443
  name: string;
4256
4444
  content: string | null;
4257
4445
  role: "function";
4446
+ } | {
4447
+ role: "developer";
4448
+ name?: string | undefined;
4449
+ content?: string | {
4450
+ type: "text";
4451
+ text?: string | undefined;
4452
+ cache_control?: {
4453
+ type: "ephemeral";
4454
+ } | undefined;
4455
+ }[] | undefined;
4258
4456
  } | {
4259
4457
  role: "model";
4260
4458
  content?: string | null | undefined;
@@ -5251,6 +5449,52 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
5251
5449
  name: string;
5252
5450
  content: string | null;
5253
5451
  role: "function";
5452
+ }>, z.ZodObject<{
5453
+ content: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodArray<z.ZodObject<{
5454
+ text: z.ZodDefault<z.ZodString>;
5455
+ type: z.ZodLiteral<"text">;
5456
+ cache_control: z.ZodOptional<z.ZodObject<{
5457
+ type: z.ZodEnum<["ephemeral"]>;
5458
+ }, "strip", z.ZodTypeAny, {
5459
+ type: "ephemeral";
5460
+ }, {
5461
+ type: "ephemeral";
5462
+ }>>;
5463
+ }, "strip", z.ZodTypeAny, {
5464
+ type: "text";
5465
+ text: string;
5466
+ cache_control?: {
5467
+ type: "ephemeral";
5468
+ } | undefined;
5469
+ }, {
5470
+ type: "text";
5471
+ text?: string | undefined;
5472
+ cache_control?: {
5473
+ type: "ephemeral";
5474
+ } | undefined;
5475
+ }>, "many">]>;
5476
+ role: z.ZodLiteral<"developer">;
5477
+ name: z.ZodOptional<z.ZodString>;
5478
+ }, "strip", z.ZodTypeAny, {
5479
+ content: string | {
5480
+ type: "text";
5481
+ text: string;
5482
+ cache_control?: {
5483
+ type: "ephemeral";
5484
+ } | undefined;
5485
+ }[];
5486
+ role: "developer";
5487
+ name?: string | undefined;
5488
+ }, {
5489
+ role: "developer";
5490
+ name?: string | undefined;
5491
+ content?: string | {
5492
+ type: "text";
5493
+ text?: string | undefined;
5494
+ cache_control?: {
5495
+ type: "ephemeral";
5496
+ } | undefined;
5497
+ }[] | undefined;
5254
5498
  }>]>, z.ZodObject<{
5255
5499
  role: z.ZodEnum<["model"]>;
5256
5500
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -5328,6 +5572,16 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
5328
5572
  name: string;
5329
5573
  content: string | null;
5330
5574
  role: "function";
5575
+ } | {
5576
+ content: string | {
5577
+ type: "text";
5578
+ text: string;
5579
+ cache_control?: {
5580
+ type: "ephemeral";
5581
+ } | undefined;
5582
+ }[];
5583
+ role: "developer";
5584
+ name?: string | undefined;
5331
5585
  } | {
5332
5586
  role: "model";
5333
5587
  content?: string | null | undefined;
@@ -5399,6 +5653,16 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
5399
5653
  name: string;
5400
5654
  content: string | null;
5401
5655
  role: "function";
5656
+ } | {
5657
+ role: "developer";
5658
+ name?: string | undefined;
5659
+ content?: string | {
5660
+ type: "text";
5661
+ text?: string | undefined;
5662
+ cache_control?: {
5663
+ type: "ephemeral";
5664
+ } | undefined;
5665
+ }[] | undefined;
5402
5666
  } | {
5403
5667
  role: "model";
5404
5668
  content?: string | null | undefined;
@@ -6086,6 +6350,16 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
6086
6350
  name: string;
6087
6351
  content: string | null;
6088
6352
  role: "function";
6353
+ } | {
6354
+ content: string | {
6355
+ type: "text";
6356
+ text: string;
6357
+ cache_control?: {
6358
+ type: "ephemeral";
6359
+ } | undefined;
6360
+ }[];
6361
+ role: "developer";
6362
+ name?: string | undefined;
6089
6363
  } | {
6090
6364
  role: "model";
6091
6365
  content?: string | null | undefined;
@@ -6285,6 +6559,16 @@ declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodOb
6285
6559
  name: string;
6286
6560
  content: string | null;
6287
6561
  role: "function";
6562
+ } | {
6563
+ role: "developer";
6564
+ name?: string | undefined;
6565
+ content?: string | {
6566
+ type: "text";
6567
+ text?: string | undefined;
6568
+ cache_control?: {
6569
+ type: "ephemeral";
6570
+ } | undefined;
6571
+ }[] | undefined;
6288
6572
  } | {
6289
6573
  role: "model";
6290
6574
  content?: string | null | undefined;
@@ -6459,7 +6743,7 @@ interface EvalHooks<Expected, Metadata extends BaseMetadata, Parameters extends
6459
6743
  /**
6460
6744
  * The task's span.
6461
6745
  */
6462
- span: Span;
6746
+ span: Span$1;
6463
6747
  /**
6464
6748
  * The current parameters being used for this specific task execution.
6465
6749
  * Array parameters are converted to single values.
@@ -6469,6 +6753,10 @@ interface EvalHooks<Expected, Metadata extends BaseMetadata, Parameters extends
6469
6753
  * Report progress that will show up in the playground.
6470
6754
  */
6471
6755
  reportProgress: (progress: TaskProgressEvent) => void;
6756
+ /**
6757
+ * The index of the current trial (0-based). This is useful when trialCount > 1.
6758
+ */
6759
+ trialIndex: number;
6472
6760
  }
6473
6761
  type EvalScorerArgs<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalCase<Input, Expected, Metadata> & {
6474
6762
  output: Output;
@@ -6482,7 +6770,7 @@ type EvalResult<Input, Output, Expected, Metadata extends BaseMetadata = Default
6482
6770
  origin?: ObjectReference;
6483
6771
  };
6484
6772
  type ErrorScoreHandler = (args: {
6485
- rootSpan: Span;
6773
+ rootSpan: Span$1;
6486
6774
  data: EvalCase<any, any, any>;
6487
6775
  unhandledScores: string[];
6488
6776
  }) => Record<string, number> | undefined | void;
@@ -6878,6 +7166,235 @@ declare function wrapAISDKModel<T extends object>(model: T): T;
6878
7166
  */
6879
7167
  declare function wrapAnthropic<T extends object>(anthropic: T): T;
6880
7168
 
7169
+ interface Context {
7170
+ [key: string]: any;
7171
+ }
7172
+ interface SpanProcessor {
7173
+ onStart(span: Span, parentContext?: Context): void;
7174
+ onEnd(span: ReadableSpan): void;
7175
+ shutdown(): Promise<void>;
7176
+ forceFlush(): Promise<void>;
7177
+ }
7178
+ interface ReadableSpan {
7179
+ name: string;
7180
+ parentSpanContext?: {
7181
+ spanId: string;
7182
+ traceId: string;
7183
+ };
7184
+ attributes?: Record<string, any>;
7185
+ spanContext(): {
7186
+ spanId: string;
7187
+ traceId: string;
7188
+ };
7189
+ }
7190
+ interface Span extends ReadableSpan {
7191
+ end(): void;
7192
+ setAttributes(attributes: Record<string, any>): void;
7193
+ setStatus(status: {
7194
+ code: number;
7195
+ message?: string;
7196
+ }): void;
7197
+ }
7198
+ /**
7199
+ * Custom filter function type for span filtering.
7200
+ * @param span - The span to evaluate
7201
+ * @returns true to definitely keep, false to definitely drop, null/undefined to not influence the decision
7202
+ */
7203
+ type CustomSpanFilter = (span: ReadableSpan) => boolean | null | undefined;
7204
+ /**
7205
+ * A span processor that filters spans to only export filtered telemetry.
7206
+ *
7207
+ * Only filtered spans and root spans will be forwarded to the inner processor.
7208
+ * This dramatically reduces telemetry volume while preserving important observability.
7209
+ *
7210
+ * @example
7211
+ * ```typescript
7212
+ * const processor = new AISpanProcessor(new BatchSpanProcessor(new OTLPTraceExporter()));
7213
+ * const provider = new TracerProvider();
7214
+ * provider.addSpanProcessor(processor);
7215
+ * ```
7216
+ */
7217
+ declare class AISpanProcessor {
7218
+ private static checkOtelAvailable;
7219
+ private readonly processor;
7220
+ private readonly customFilter;
7221
+ /**
7222
+ * Initialize the filter span processor.
7223
+ *
7224
+ * @param processor - The wrapped span processor that will receive filtered spans
7225
+ * @param customFilter - Optional function that takes a span and returns:
7226
+ * true to keep, false to drop,
7227
+ * null/undefined to not influence the decision
7228
+ */
7229
+ constructor(processor: SpanProcessor, customFilter?: CustomSpanFilter);
7230
+ /**
7231
+ * Forward span start events to the inner processor.
7232
+ */
7233
+ onStart(span: Span, parentContext: Context): void;
7234
+ /**
7235
+ * Apply filtering logic and conditionally forward span end events.
7236
+ */
7237
+ onEnd(span: ReadableSpan): void;
7238
+ /**
7239
+ * Shutdown the inner processor.
7240
+ */
7241
+ shutdown(): Promise<void>;
7242
+ /**
7243
+ * Force flush the inner processor.
7244
+ */
7245
+ forceFlush(): Promise<void>;
7246
+ /**
7247
+ * Determine if a span should be kept based on filtering criteria.
7248
+ *
7249
+ * Keep spans if:
7250
+ * 1. It's a root span (no parent)
7251
+ * 2. Custom filter returns true/false (if provided)
7252
+ * 3. Span name starts with 'gen_ai.', 'braintrust.', 'llm.', or 'ai.'
7253
+ * 4. Any attribute name starts with those prefixes
7254
+ */
7255
+ private shouldKeepFilteredSpan;
7256
+ }
7257
+ interface BraintrustSpanProcessorOptions {
7258
+ /**
7259
+ * Braintrust API key. If not provided, will use BRAINTRUST_API_KEY environment variable.
7260
+ */
7261
+ apiKey?: string;
7262
+ /**
7263
+ * Braintrust API URL. If not provided, will use BRAINTRUST_API_URL environment variable. Defaults to https://api.braintrust.dev
7264
+ */
7265
+ apiUrl?: string;
7266
+ /**
7267
+ * Braintrust parent project name (e.g., "project_name:otel_examples"). If not provided, will use BRAINTRUST_PARENT environment variable.
7268
+ */
7269
+ parent?: string;
7270
+ /**
7271
+ * Whether to enable AI span filtering. Defaults to false.
7272
+ */
7273
+ filterAISpans?: boolean;
7274
+ /**
7275
+ * Custom filter function for span filtering
7276
+ */
7277
+ customFilter?: CustomSpanFilter;
7278
+ /**
7279
+ * Additional headers to send with telemetry data
7280
+ */
7281
+ headers?: Record<string, string>;
7282
+ }
7283
+ /**
7284
+ * A span processor that sends OpenTelemetry spans to Braintrust.
7285
+ *
7286
+ * This processor uses a BatchSpanProcessor and an OTLP exporter configured
7287
+ * to send data to Braintrust's telemetry endpoint. Span filtering is disabled
7288
+ * by default but can be enabled with the filterAISpans option.
7289
+ *
7290
+ * Environment Variables:
7291
+ * - BRAINTRUST_API_KEY: Your Braintrust API key
7292
+ * - BRAINTRUST_PARENT: Parent identifier (e.g., "project_name:test")
7293
+ * - BRAINTRUST_API_URL: Base URL for Braintrust API (defaults to https://api.braintrust.dev)
7294
+ *
7295
+ * @example
7296
+ * ```typescript
7297
+ * const processor = new BraintrustSpanProcessor({
7298
+ * apiKey: 'your-api-key',
7299
+ * apiUrl: 'https://api.braintrust.dev'
7300
+ * });
7301
+ * const provider = new TracerProvider();
7302
+ * provider.addSpanProcessor(processor);
7303
+ * ```
7304
+ *
7305
+ * @example With span filtering enabled:
7306
+ * ```typescript
7307
+ * const processor = new BraintrustSpanProcessor({
7308
+ * apiKey: 'your-api-key',
7309
+ * filterAISpans: true
7310
+ * });
7311
+ * ```
7312
+ *
7313
+ * @example Using environment variables:
7314
+ * ```typescript
7315
+ * // Set environment variables:
7316
+ * // BRAINTRUST_API_KEY=your-api-key
7317
+ * // BRAINTRUST_PARENT=project_name:test
7318
+ * // BRAINTRUST_API_URL=https://api.braintrust.dev
7319
+ * const processor = new BraintrustSpanProcessor();
7320
+ * ```
7321
+ */
7322
+ declare class BraintrustSpanProcessor {
7323
+ private static checkOtelAvailable;
7324
+ private readonly processor;
7325
+ private readonly aiSpanProcessor;
7326
+ constructor(options?: BraintrustSpanProcessorOptions);
7327
+ onStart(span: Span, parentContext: Context): void;
7328
+ onEnd(span: ReadableSpan): void;
7329
+ shutdown(): Promise<void>;
7330
+ forceFlush(): Promise<void>;
7331
+ }
7332
+ /**
7333
+ * A trace exporter that sends OpenTelemetry spans to Braintrust.
7334
+ *
7335
+ * This exporter wraps the standard OTLP trace exporter and can be used with
7336
+ * any OpenTelemetry setup, including @vercel/otel's registerOTel function,
7337
+ * NodeSDK, or custom tracer providers. It can optionally filter spans to
7338
+ * only send AI-related telemetry.
7339
+ *
7340
+ * Environment Variables:
7341
+ * - BRAINTRUST_API_KEY: Your Braintrust API key
7342
+ * - BRAINTRUST_PARENT: Parent identifier (e.g., "project_name:test")
7343
+ * - BRAINTRUST_API_URL: Base URL for Braintrust API (defaults to https://api.braintrust.dev)
7344
+ *
7345
+ * @example With @vercel/otel:
7346
+ * ```typescript
7347
+ * import { registerOTel } from '@vercel/otel';
7348
+ * import { BraintrustExporter } from 'braintrust';
7349
+ *
7350
+ * export function register() {
7351
+ * registerOTel({
7352
+ * serviceName: 'my-app',
7353
+ * traceExporter: new BraintrustExporter({
7354
+ * filterAISpans: true,
7355
+ * }),
7356
+ * });
7357
+ * }
7358
+ * ```
7359
+ *
7360
+ * @example With NodeSDK:
7361
+ * ```typescript
7362
+ * import { NodeSDK } from '@opentelemetry/sdk-node';
7363
+ * import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
7364
+ * import { BraintrustExporter } from 'braintrust';
7365
+ *
7366
+ * const sdk = new NodeSDK({
7367
+ * spanProcessors: [
7368
+ * new BatchSpanProcessor(new BraintrustExporter({
7369
+ * apiKey: 'your-api-key',
7370
+ * parent: 'project_name:test'
7371
+ * }))
7372
+ * ]
7373
+ * });
7374
+ * ```
7375
+ */
7376
+ declare class BraintrustExporter {
7377
+ private static checkOtelAvailable;
7378
+ private readonly processor;
7379
+ private readonly spans;
7380
+ private readonly callbacks;
7381
+ constructor(options?: BraintrustSpanProcessorOptions);
7382
+ /**
7383
+ * Export spans to Braintrust by simulating span processor behavior.
7384
+ */
7385
+ export(spans: ReadableSpan[], resultCallback: (result: any) => void): void;
7386
+ /**
7387
+ * Shutdown the exporter.
7388
+ */
7389
+ shutdown(): Promise<void>;
7390
+ /**
7391
+ * Force flush the exporter.
7392
+ */
7393
+ forceFlush(): Promise<void>;
7394
+ }
7395
+
7396
+ type braintrust_AISpanProcessor = AISpanProcessor;
7397
+ declare const braintrust_AISpanProcessor: typeof AISpanProcessor;
6881
7398
  type braintrust_AnyDataset = AnyDataset;
6882
7399
  type braintrust_Attachment = Attachment;
6883
7400
  declare const braintrust_Attachment: typeof Attachment;
@@ -6887,6 +7404,10 @@ type braintrust_BaseAttachment = BaseAttachment;
6887
7404
  declare const braintrust_BaseAttachment: typeof BaseAttachment;
6888
7405
  declare const braintrust_BaseExperiment: typeof BaseExperiment;
6889
7406
  type braintrust_BaseMetadata = BaseMetadata;
7407
+ type braintrust_BraintrustExporter = BraintrustExporter;
7408
+ declare const braintrust_BraintrustExporter: typeof BraintrustExporter;
7409
+ type braintrust_BraintrustSpanProcessor = BraintrustSpanProcessor;
7410
+ declare const braintrust_BraintrustSpanProcessor: typeof BraintrustSpanProcessor;
6890
7411
  type braintrust_BraintrustState = BraintrustState;
6891
7412
  declare const braintrust_BraintrustState: typeof BraintrustState;
6892
7413
  type braintrust_BraintrustStream = BraintrustStream;
@@ -6977,7 +7498,6 @@ declare const braintrust_ScorerBuilder: typeof ScorerBuilder;
6977
7498
  type braintrust_ScorerOpts<Output, Input, Params, Returns, Fn extends GenericFunction<Exact<Params, ScorerArgs<Output, Input>>, Returns>> = ScorerOpts<Output, Input, Params, Returns, Fn>;
6978
7499
  type braintrust_SerializedBraintrustState = SerializedBraintrustState;
6979
7500
  type braintrust_SetCurrentArg = SetCurrentArg;
6980
- type braintrust_Span = Span;
6981
7501
  type braintrust_SpanContext = SpanContext;
6982
7502
  type braintrust_SpanImpl = SpanImpl;
6983
7503
  declare const braintrust_SpanImpl: typeof SpanImpl;
@@ -7044,7 +7564,7 @@ declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
7044
7564
  declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
7045
7565
  declare const braintrust_wrapTraced: typeof wrapTraced;
7046
7566
  declare namespace braintrust {
7047
- export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type braintrust_Span as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, type braintrust_WithTransactionId as WithTransactionId, braintrust_X_CACHED_HEADER as X_CACHED_HEADER, braintrust__exportsForTestingOnly as _exportsForTestingOnly, braintrust__internalGetGlobalState as _internalGetGlobalState, braintrust__internalSetInitialState as _internalSetInitialState, braintrust_braintrustStreamChunkSchema as braintrustStreamChunkSchema, braintrust_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, braintrust_init as init, braintrust_initDataset as initDataset, braintrust_initExperiment as initExperiment, braintrust_initFunction as initFunction, braintrust_initLogger as initLogger, braintrust_invoke as invoke, braintrust_loadPrompt as loadPrompt, braintrust_log as log, braintrust_logError as logError, braintrust_login as login, braintrust_loginToState as loginToState, braintrust_newId as newId, braintrust_parseCachedHeader as parseCachedHeader, braintrust_permalink as permalink, braintrust_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, braintrust_toolFunctionDefinitionSchema as toolFunctionDefinitionSchema, braintrust_traceable as traceable, braintrust_traced as traced, braintrust_updateSpan as updateSpan, braintrust_withCurrent as withCurrent, braintrust_withDataset as withDataset, braintrust_withExperiment as withExperiment, braintrust_withLogger as withLogger, braintrust_withParent as withParent, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
7567
+ export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, type braintrust_WithTransactionId as WithTransactionId, braintrust_X_CACHED_HEADER as X_CACHED_HEADER, braintrust__exportsForTestingOnly as _exportsForTestingOnly, braintrust__internalGetGlobalState as _internalGetGlobalState, braintrust__internalSetInitialState as _internalSetInitialState, braintrust_braintrustStreamChunkSchema as braintrustStreamChunkSchema, braintrust_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, braintrust_init as init, braintrust_initDataset as initDataset, braintrust_initExperiment as initExperiment, braintrust_initFunction as initFunction, braintrust_initLogger as initLogger, braintrust_invoke as invoke, braintrust_loadPrompt as loadPrompt, braintrust_log as log, braintrust_logError as logError, braintrust_login as login, braintrust_loginToState as loginToState, braintrust_newId as newId, braintrust_parseCachedHeader as parseCachedHeader, braintrust_permalink as permalink, braintrust_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, braintrust_toolFunctionDefinitionSchema as toolFunctionDefinitionSchema, braintrust_traceable as traceable, braintrust_traced as traced, braintrust_updateSpan as updateSpan, braintrust_withCurrent as withCurrent, braintrust_withDataset as withDataset, braintrust_withExperiment as withExperiment, braintrust_withLogger as withLogger, braintrust_withParent as withParent, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
7048
7568
  }
7049
7569
 
7050
7570
  type EvaluatorManifest = Record<string, EvaluatorDef<unknown, unknown, unknown, BaseMetadata>>;
@@ -7400,6 +7920,52 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
7400
7920
  name: string;
7401
7921
  content: string | null;
7402
7922
  role: "function";
7923
+ }>, z.ZodObject<{
7924
+ content: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodArray<z.ZodObject<{
7925
+ text: z.ZodDefault<z.ZodString>;
7926
+ type: z.ZodLiteral<"text">;
7927
+ cache_control: z.ZodOptional<z.ZodObject<{
7928
+ type: z.ZodEnum<["ephemeral"]>;
7929
+ }, "strip", z.ZodTypeAny, {
7930
+ type: "ephemeral";
7931
+ }, {
7932
+ type: "ephemeral";
7933
+ }>>;
7934
+ }, "strip", z.ZodTypeAny, {
7935
+ type: "text";
7936
+ text: string;
7937
+ cache_control?: {
7938
+ type: "ephemeral";
7939
+ } | undefined;
7940
+ }, {
7941
+ type: "text";
7942
+ text?: string | undefined;
7943
+ cache_control?: {
7944
+ type: "ephemeral";
7945
+ } | undefined;
7946
+ }>, "many">]>;
7947
+ role: z.ZodLiteral<"developer">;
7948
+ name: z.ZodOptional<z.ZodString>;
7949
+ }, "strip", z.ZodTypeAny, {
7950
+ content: string | {
7951
+ type: "text";
7952
+ text: string;
7953
+ cache_control?: {
7954
+ type: "ephemeral";
7955
+ } | undefined;
7956
+ }[];
7957
+ role: "developer";
7958
+ name?: string | undefined;
7959
+ }, {
7960
+ role: "developer";
7961
+ name?: string | undefined;
7962
+ content?: string | {
7963
+ type: "text";
7964
+ text?: string | undefined;
7965
+ cache_control?: {
7966
+ type: "ephemeral";
7967
+ } | undefined;
7968
+ }[] | undefined;
7403
7969
  }>]>, z.ZodObject<{
7404
7970
  role: z.ZodEnum<["model"]>;
7405
7971
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -7423,6 +7989,16 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
7423
7989
  }[];
7424
7990
  role: "system";
7425
7991
  name?: string | undefined;
7992
+ } | {
7993
+ content: string | {
7994
+ type: "text";
7995
+ text: string;
7996
+ cache_control?: {
7997
+ type: "ephemeral";
7998
+ } | undefined;
7999
+ }[];
8000
+ role: "developer";
8001
+ name?: string | undefined;
7426
8002
  } | {
7427
8003
  content: string | ({
7428
8004
  type: "text";
@@ -7496,6 +8072,16 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
7496
8072
  type: "ephemeral";
7497
8073
  } | undefined;
7498
8074
  }[] | undefined;
8075
+ } | {
8076
+ role: "developer";
8077
+ name?: string | undefined;
8078
+ content?: string | {
8079
+ type: "text";
8080
+ text?: string | undefined;
8081
+ cache_control?: {
8082
+ type: "ephemeral";
8083
+ } | undefined;
8084
+ }[] | undefined;
7499
8085
  } | {
7500
8086
  role: "user";
7501
8087
  name?: string | undefined;
@@ -8291,6 +8877,16 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
8291
8877
  }[];
8292
8878
  role: "system";
8293
8879
  name?: string | undefined;
8880
+ } | {
8881
+ content: string | {
8882
+ type: "text";
8883
+ text: string;
8884
+ cache_control?: {
8885
+ type: "ephemeral";
8886
+ } | undefined;
8887
+ }[];
8888
+ role: "developer";
8889
+ name?: string | undefined;
8294
8890
  } | {
8295
8891
  content: string | ({
8296
8892
  type: "text";
@@ -8500,6 +9096,16 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
8500
9096
  type: "ephemeral";
8501
9097
  } | undefined;
8502
9098
  }[] | undefined;
9099
+ } | {
9100
+ role: "developer";
9101
+ name?: string | undefined;
9102
+ content?: string | {
9103
+ type: "text";
9104
+ text?: string | undefined;
9105
+ cache_control?: {
9106
+ type: "ephemeral";
9107
+ } | undefined;
9108
+ }[] | undefined;
8503
9109
  } | {
8504
9110
  role: "user";
8505
9111
  name?: string | undefined;
@@ -8713,6 +9319,16 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
8713
9319
  }[];
8714
9320
  role: "system";
8715
9321
  name?: string | undefined;
9322
+ } | {
9323
+ content: string | {
9324
+ type: "text";
9325
+ text: string;
9326
+ cache_control?: {
9327
+ type: "ephemeral";
9328
+ } | undefined;
9329
+ }[];
9330
+ role: "developer";
9331
+ name?: string | undefined;
8716
9332
  } | {
8717
9333
  content: string | ({
8718
9334
  type: "text";
@@ -8926,6 +9542,16 @@ declare const evalParametersSerializedSchema: z.ZodRecord<z.ZodString, z.ZodUnio
8926
9542
  type: "ephemeral";
8927
9543
  } | undefined;
8928
9544
  }[] | undefined;
9545
+ } | {
9546
+ role: "developer";
9547
+ name?: string | undefined;
9548
+ content?: string | {
9549
+ type: "text";
9550
+ text?: string | undefined;
9551
+ cache_control?: {
9552
+ type: "ephemeral";
9553
+ } | undefined;
9554
+ }[] | undefined;
8929
9555
  } | {
8930
9556
  role: "user";
8931
9557
  name?: string | undefined;
@@ -9377,6 +10003,52 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
9377
10003
  name: string;
9378
10004
  content: string | null;
9379
10005
  role: "function";
10006
+ }>, z.ZodObject<{
10007
+ content: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodArray<z.ZodObject<{
10008
+ text: z.ZodDefault<z.ZodString>;
10009
+ type: z.ZodLiteral<"text">;
10010
+ cache_control: z.ZodOptional<z.ZodObject<{
10011
+ type: z.ZodEnum<["ephemeral"]>;
10012
+ }, "strip", z.ZodTypeAny, {
10013
+ type: "ephemeral";
10014
+ }, {
10015
+ type: "ephemeral";
10016
+ }>>;
10017
+ }, "strip", z.ZodTypeAny, {
10018
+ type: "text";
10019
+ text: string;
10020
+ cache_control?: {
10021
+ type: "ephemeral";
10022
+ } | undefined;
10023
+ }, {
10024
+ type: "text";
10025
+ text?: string | undefined;
10026
+ cache_control?: {
10027
+ type: "ephemeral";
10028
+ } | undefined;
10029
+ }>, "many">]>;
10030
+ role: z.ZodLiteral<"developer">;
10031
+ name: z.ZodOptional<z.ZodString>;
10032
+ }, "strip", z.ZodTypeAny, {
10033
+ content: string | {
10034
+ type: "text";
10035
+ text: string;
10036
+ cache_control?: {
10037
+ type: "ephemeral";
10038
+ } | undefined;
10039
+ }[];
10040
+ role: "developer";
10041
+ name?: string | undefined;
10042
+ }, {
10043
+ role: "developer";
10044
+ name?: string | undefined;
10045
+ content?: string | {
10046
+ type: "text";
10047
+ text?: string | undefined;
10048
+ cache_control?: {
10049
+ type: "ephemeral";
10050
+ } | undefined;
10051
+ }[] | undefined;
9380
10052
  }>]>, z.ZodObject<{
9381
10053
  role: z.ZodEnum<["model"]>;
9382
10054
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -9400,6 +10072,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
9400
10072
  }[];
9401
10073
  role: "system";
9402
10074
  name?: string | undefined;
10075
+ } | {
10076
+ content: string | {
10077
+ type: "text";
10078
+ text: string;
10079
+ cache_control?: {
10080
+ type: "ephemeral";
10081
+ } | undefined;
10082
+ }[];
10083
+ role: "developer";
10084
+ name?: string | undefined;
9403
10085
  } | {
9404
10086
  content: string | ({
9405
10087
  type: "text";
@@ -9473,6 +10155,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
9473
10155
  type: "ephemeral";
9474
10156
  } | undefined;
9475
10157
  }[] | undefined;
10158
+ } | {
10159
+ role: "developer";
10160
+ name?: string | undefined;
10161
+ content?: string | {
10162
+ type: "text";
10163
+ text?: string | undefined;
10164
+ cache_control?: {
10165
+ type: "ephemeral";
10166
+ } | undefined;
10167
+ }[] | undefined;
9476
10168
  } | {
9477
10169
  role: "user";
9478
10170
  name?: string | undefined;
@@ -10268,6 +10960,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
10268
10960
  }[];
10269
10961
  role: "system";
10270
10962
  name?: string | undefined;
10963
+ } | {
10964
+ content: string | {
10965
+ type: "text";
10966
+ text: string;
10967
+ cache_control?: {
10968
+ type: "ephemeral";
10969
+ } | undefined;
10970
+ }[];
10971
+ role: "developer";
10972
+ name?: string | undefined;
10271
10973
  } | {
10272
10974
  content: string | ({
10273
10975
  type: "text";
@@ -10477,6 +11179,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
10477
11179
  type: "ephemeral";
10478
11180
  } | undefined;
10479
11181
  }[] | undefined;
11182
+ } | {
11183
+ role: "developer";
11184
+ name?: string | undefined;
11185
+ content?: string | {
11186
+ type: "text";
11187
+ text?: string | undefined;
11188
+ cache_control?: {
11189
+ type: "ephemeral";
11190
+ } | undefined;
11191
+ }[] | undefined;
10480
11192
  } | {
10481
11193
  role: "user";
10482
11194
  name?: string | undefined;
@@ -10690,6 +11402,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
10690
11402
  }[];
10691
11403
  role: "system";
10692
11404
  name?: string | undefined;
11405
+ } | {
11406
+ content: string | {
11407
+ type: "text";
11408
+ text: string;
11409
+ cache_control?: {
11410
+ type: "ephemeral";
11411
+ } | undefined;
11412
+ }[];
11413
+ role: "developer";
11414
+ name?: string | undefined;
10693
11415
  } | {
10694
11416
  content: string | ({
10695
11417
  type: "text";
@@ -10903,6 +11625,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
10903
11625
  type: "ephemeral";
10904
11626
  } | undefined;
10905
11627
  }[] | undefined;
11628
+ } | {
11629
+ role: "developer";
11630
+ name?: string | undefined;
11631
+ content?: string | {
11632
+ type: "text";
11633
+ text?: string | undefined;
11634
+ cache_control?: {
11635
+ type: "ephemeral";
11636
+ } | undefined;
11637
+ }[] | undefined;
10906
11638
  } | {
10907
11639
  role: "user";
10908
11640
  name?: string | undefined;
@@ -11133,6 +11865,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
11133
11865
  }[];
11134
11866
  role: "system";
11135
11867
  name?: string | undefined;
11868
+ } | {
11869
+ content: string | {
11870
+ type: "text";
11871
+ text: string;
11872
+ cache_control?: {
11873
+ type: "ephemeral";
11874
+ } | undefined;
11875
+ }[];
11876
+ role: "developer";
11877
+ name?: string | undefined;
11136
11878
  } | {
11137
11879
  content: string | ({
11138
11880
  type: "text";
@@ -11353,6 +12095,16 @@ declare const evaluatorDefinitionSchema: z.ZodObject<{
11353
12095
  type: "ephemeral";
11354
12096
  } | undefined;
11355
12097
  }[] | undefined;
12098
+ } | {
12099
+ role: "developer";
12100
+ name?: string | undefined;
12101
+ content?: string | {
12102
+ type: "text";
12103
+ text?: string | undefined;
12104
+ cache_control?: {
12105
+ type: "ephemeral";
12106
+ } | undefined;
12107
+ }[] | undefined;
11356
12108
  } | {
11357
12109
  role: "user";
11358
12110
  name?: string | undefined;
@@ -11795,6 +12547,52 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
11795
12547
  name: string;
11796
12548
  content: string | null;
11797
12549
  role: "function";
12550
+ }>, z.ZodObject<{
12551
+ content: z.ZodUnion<[z.ZodDefault<z.ZodString>, z.ZodArray<z.ZodObject<{
12552
+ text: z.ZodDefault<z.ZodString>;
12553
+ type: z.ZodLiteral<"text">;
12554
+ cache_control: z.ZodOptional<z.ZodObject<{
12555
+ type: z.ZodEnum<["ephemeral"]>;
12556
+ }, "strip", z.ZodTypeAny, {
12557
+ type: "ephemeral";
12558
+ }, {
12559
+ type: "ephemeral";
12560
+ }>>;
12561
+ }, "strip", z.ZodTypeAny, {
12562
+ type: "text";
12563
+ text: string;
12564
+ cache_control?: {
12565
+ type: "ephemeral";
12566
+ } | undefined;
12567
+ }, {
12568
+ type: "text";
12569
+ text?: string | undefined;
12570
+ cache_control?: {
12571
+ type: "ephemeral";
12572
+ } | undefined;
12573
+ }>, "many">]>;
12574
+ role: z.ZodLiteral<"developer">;
12575
+ name: z.ZodOptional<z.ZodString>;
12576
+ }, "strip", z.ZodTypeAny, {
12577
+ content: string | {
12578
+ type: "text";
12579
+ text: string;
12580
+ cache_control?: {
12581
+ type: "ephemeral";
12582
+ } | undefined;
12583
+ }[];
12584
+ role: "developer";
12585
+ name?: string | undefined;
12586
+ }, {
12587
+ role: "developer";
12588
+ name?: string | undefined;
12589
+ content?: string | {
12590
+ type: "text";
12591
+ text?: string | undefined;
12592
+ cache_control?: {
12593
+ type: "ephemeral";
12594
+ } | undefined;
12595
+ }[] | undefined;
11798
12596
  }>]>, z.ZodObject<{
11799
12597
  role: z.ZodEnum<["model"]>;
11800
12598
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -11818,6 +12616,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
11818
12616
  }[];
11819
12617
  role: "system";
11820
12618
  name?: string | undefined;
12619
+ } | {
12620
+ content: string | {
12621
+ type: "text";
12622
+ text: string;
12623
+ cache_control?: {
12624
+ type: "ephemeral";
12625
+ } | undefined;
12626
+ }[];
12627
+ role: "developer";
12628
+ name?: string | undefined;
11821
12629
  } | {
11822
12630
  content: string | ({
11823
12631
  type: "text";
@@ -11891,6 +12699,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
11891
12699
  type: "ephemeral";
11892
12700
  } | undefined;
11893
12701
  }[] | undefined;
12702
+ } | {
12703
+ role: "developer";
12704
+ name?: string | undefined;
12705
+ content?: string | {
12706
+ type: "text";
12707
+ text?: string | undefined;
12708
+ cache_control?: {
12709
+ type: "ephemeral";
12710
+ } | undefined;
12711
+ }[] | undefined;
11894
12712
  } | {
11895
12713
  role: "user";
11896
12714
  name?: string | undefined;
@@ -12686,6 +13504,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
12686
13504
  }[];
12687
13505
  role: "system";
12688
13506
  name?: string | undefined;
13507
+ } | {
13508
+ content: string | {
13509
+ type: "text";
13510
+ text: string;
13511
+ cache_control?: {
13512
+ type: "ephemeral";
13513
+ } | undefined;
13514
+ }[];
13515
+ role: "developer";
13516
+ name?: string | undefined;
12689
13517
  } | {
12690
13518
  content: string | ({
12691
13519
  type: "text";
@@ -12895,6 +13723,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
12895
13723
  type: "ephemeral";
12896
13724
  } | undefined;
12897
13725
  }[] | undefined;
13726
+ } | {
13727
+ role: "developer";
13728
+ name?: string | undefined;
13729
+ content?: string | {
13730
+ type: "text";
13731
+ text?: string | undefined;
13732
+ cache_control?: {
13733
+ type: "ephemeral";
13734
+ } | undefined;
13735
+ }[] | undefined;
12898
13736
  } | {
12899
13737
  role: "user";
12900
13738
  name?: string | undefined;
@@ -13108,6 +13946,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
13108
13946
  }[];
13109
13947
  role: "system";
13110
13948
  name?: string | undefined;
13949
+ } | {
13950
+ content: string | {
13951
+ type: "text";
13952
+ text: string;
13953
+ cache_control?: {
13954
+ type: "ephemeral";
13955
+ } | undefined;
13956
+ }[];
13957
+ role: "developer";
13958
+ name?: string | undefined;
13111
13959
  } | {
13112
13960
  content: string | ({
13113
13961
  type: "text";
@@ -13321,6 +14169,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
13321
14169
  type: "ephemeral";
13322
14170
  } | undefined;
13323
14171
  }[] | undefined;
14172
+ } | {
14173
+ role: "developer";
14174
+ name?: string | undefined;
14175
+ content?: string | {
14176
+ type: "text";
14177
+ text?: string | undefined;
14178
+ cache_control?: {
14179
+ type: "ephemeral";
14180
+ } | undefined;
14181
+ }[] | undefined;
13324
14182
  } | {
13325
14183
  role: "user";
13326
14184
  name?: string | undefined;
@@ -13551,6 +14409,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
13551
14409
  }[];
13552
14410
  role: "system";
13553
14411
  name?: string | undefined;
14412
+ } | {
14413
+ content: string | {
14414
+ type: "text";
14415
+ text: string;
14416
+ cache_control?: {
14417
+ type: "ephemeral";
14418
+ } | undefined;
14419
+ }[];
14420
+ role: "developer";
14421
+ name?: string | undefined;
13554
14422
  } | {
13555
14423
  content: string | ({
13556
14424
  type: "text";
@@ -13771,6 +14639,16 @@ declare const evaluatorDefinitionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
13771
14639
  type: "ephemeral";
13772
14640
  } | undefined;
13773
14641
  }[] | undefined;
14642
+ } | {
14643
+ role: "developer";
14644
+ name?: string | undefined;
14645
+ content?: string | {
14646
+ type: "text";
14647
+ text?: string | undefined;
14648
+ cache_control?: {
14649
+ type: "ephemeral";
14650
+ } | undefined;
14651
+ }[] | undefined;
13774
14652
  } | {
13775
14653
  role: "user";
13776
14654
  name?: string | undefined;
@@ -13914,4 +14792,4 @@ type EvaluatorDefinitions = z.infer<typeof evaluatorDefinitionsSchema>;
13914
14792
  * @module braintrust
13915
14793
  */
13916
14794
 
13917
- export { type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type CreateProjectOpts, type DataSummary, Dataset, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, INTERNAL_BTQL_LIMIT, type InitOptions, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, LazyValue, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, type ObjectMetadata, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDKModel, wrapAnthropic, wrapOpenAI, wrapOpenAIv4, wrapTraced };
14795
+ export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type CreateProjectOpts, type DataSummary, Dataset, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, INTERNAL_BTQL_LIMIT, type InitOptions, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, LazyValue, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, type ObjectMetadata, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDKModel, wrapAnthropic, wrapOpenAI, wrapOpenAIv4, wrapTraced };