braintrust 0.2.5 → 0.2.6

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.
@@ -935,26 +935,6 @@ declare const ChatCompletionTool: z.ZodObject<{
935
935
  type: "function";
936
936
  }>;
937
937
  type ChatCompletionToolType = z.infer<typeof ChatCompletionTool>;
938
- declare const ObjectReference: z.ZodUnion<[z.ZodObject<{
939
- object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
940
- object_id: z.ZodString;
941
- id: z.ZodString;
942
- _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
943
- created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
944
- }, "strip", z.ZodTypeAny, {
945
- id: string;
946
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
947
- object_id: string;
948
- created?: string | null | undefined;
949
- _xact_id?: string | null | undefined;
950
- }, {
951
- id: string;
952
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
953
- object_id: string;
954
- created?: string | null | undefined;
955
- _xact_id?: string | null | undefined;
956
- }>, z.ZodNull]>;
957
- type ObjectReferenceType = z.infer<typeof ObjectReference>;
958
938
  declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
959
939
  commit: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
960
940
  branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
@@ -4700,6 +4680,26 @@ declare const GitMetadataSettings: z.ZodObject<{
4700
4680
  type GitMetadataSettingsType = z.infer<typeof GitMetadataSettings>;
4701
4681
  declare const IfExists: z.ZodEnum<["error", "ignore", "replace"]>;
4702
4682
  type IfExistsType = z.infer<typeof IfExists>;
4683
+ declare const ObjectReference: z.ZodObject<{
4684
+ object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
4685
+ object_id: z.ZodString;
4686
+ id: z.ZodString;
4687
+ _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
4688
+ created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
4689
+ }, "strip", z.ZodTypeAny, {
4690
+ id: string;
4691
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
4692
+ object_id: string;
4693
+ created?: string | null | undefined;
4694
+ _xact_id?: string | null | undefined;
4695
+ }, {
4696
+ id: string;
4697
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
4698
+ object_id: string;
4699
+ created?: string | null | undefined;
4700
+ _xact_id?: string | null | undefined;
4701
+ }>;
4702
+ type ObjectReferenceType = z.infer<typeof ObjectReference>;
4703
4703
  declare const Prompt$1: z.ZodObject<{
4704
4704
  id: z.ZodString;
4705
4705
  _xact_id: z.ZodString;
@@ -935,26 +935,6 @@ declare const ChatCompletionTool: z.ZodObject<{
935
935
  type: "function";
936
936
  }>;
937
937
  type ChatCompletionToolType = z.infer<typeof ChatCompletionTool>;
938
- declare const ObjectReference: z.ZodUnion<[z.ZodObject<{
939
- object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
940
- object_id: z.ZodString;
941
- id: z.ZodString;
942
- _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
943
- created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
944
- }, "strip", z.ZodTypeAny, {
945
- id: string;
946
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
947
- object_id: string;
948
- created?: string | null | undefined;
949
- _xact_id?: string | null | undefined;
950
- }, {
951
- id: string;
952
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
953
- object_id: string;
954
- created?: string | null | undefined;
955
- _xact_id?: string | null | undefined;
956
- }>, z.ZodNull]>;
957
- type ObjectReferenceType = z.infer<typeof ObjectReference>;
958
938
  declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
959
939
  commit: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
960
940
  branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
@@ -4700,6 +4680,26 @@ declare const GitMetadataSettings: z.ZodObject<{
4700
4680
  type GitMetadataSettingsType = z.infer<typeof GitMetadataSettings>;
4701
4681
  declare const IfExists: z.ZodEnum<["error", "ignore", "replace"]>;
4702
4682
  type IfExistsType = z.infer<typeof IfExists>;
4683
+ declare const ObjectReference: z.ZodObject<{
4684
+ object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
4685
+ object_id: z.ZodString;
4686
+ id: z.ZodString;
4687
+ _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
4688
+ created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
4689
+ }, "strip", z.ZodTypeAny, {
4690
+ id: string;
4691
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
4692
+ object_id: string;
4693
+ created?: string | null | undefined;
4694
+ _xact_id?: string | null | undefined;
4695
+ }, {
4696
+ id: string;
4697
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
4698
+ object_id: string;
4699
+ created?: string | null | undefined;
4700
+ _xact_id?: string | null | undefined;
4701
+ }>;
4702
+ type ObjectReferenceType = z.infer<typeof ObjectReference>;
4703
4703
  declare const Prompt$1: z.ZodObject<{
4704
4704
  id: z.ZodString;
4705
4705
  _xact_id: z.ZodString;
package/dev/dist/index.js CHANGED
@@ -382,7 +382,7 @@ var ResponseFormatJsonSchema = _zod.z.object({
382
382
  schema: _zod.z.union([_zod.z.object({}).partial().passthrough(), _zod.z.string()]).optional(),
383
383
  strict: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional()
384
384
  });
385
- var ResponseFormat = _zod.z.union([
385
+ var ResponseFormatNullish = _zod.z.union([
386
386
  _zod.z.object({ type: _zod.z.literal("json_object") }),
387
387
  _zod.z.object({
388
388
  type: _zod.z.literal("json_schema"),
@@ -398,7 +398,7 @@ var AnyModelParams = _zod.z.object({
398
398
  max_completion_tokens: _zod.z.number().optional(),
399
399
  frequency_penalty: _zod.z.number().optional(),
400
400
  presence_penalty: _zod.z.number().optional(),
401
- response_format: ResponseFormat.optional(),
401
+ response_format: ResponseFormatNullish.optional(),
402
402
  tool_choice: _zod.z.union([
403
403
  _zod.z.literal("auto"),
404
404
  _zod.z.literal("none"),
@@ -436,6 +436,23 @@ var ApiKey = _zod.z.object({
436
436
  user_family_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
437
437
  org_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional()
438
438
  });
439
+ var AsyncScoringState = _zod.z.union([
440
+ _zod.z.object({
441
+ status: _zod.z.literal("enabled"),
442
+ token: _zod.z.string(),
443
+ function_ids: _zod.z.array(_zod.z.unknown()).min(1),
444
+ skip_logging: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional()
445
+ }),
446
+ _zod.z.object({ status: _zod.z.literal("disabled") }),
447
+ _zod.z.null(),
448
+ _zod.z.null()
449
+ ]);
450
+ var AsyncScoringControl = _zod.z.union([
451
+ _zod.z.object({ kind: _zod.z.literal("score_update"), token: _zod.z.string() }),
452
+ _zod.z.object({ kind: _zod.z.literal("state_override"), state: AsyncScoringState }),
453
+ _zod.z.object({ kind: _zod.z.literal("state_force_reselect") }),
454
+ _zod.z.object({ kind: _zod.z.literal("state_enabled_force_rescore") })
455
+ ]);
439
456
  var BraintrustAttachmentReference = _zod.z.object({
440
457
  type: _zod.z.literal("braintrust_attachment"),
441
458
  filename: _zod.z.string().min(1),
@@ -638,7 +655,7 @@ var Dataset = _zod.z.object({
638
655
  user_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
639
656
  metadata: _zod.z.union([_zod.z.object({}).partial().passthrough(), _zod.z.null()]).optional()
640
657
  });
641
- var ObjectReference = _zod.z.union([
658
+ var ObjectReferenceNullish = _zod.z.union([
642
659
  _zod.z.object({
643
660
  object_type: _zod.z.enum([
644
661
  "project_logs",
@@ -672,7 +689,7 @@ var DatasetEvent = _zod.z.object({
672
689
  span_id: _zod.z.string(),
673
690
  root_span_id: _zod.z.string(),
674
691
  is_root: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional(),
675
- origin: ObjectReference.optional()
692
+ origin: ObjectReferenceNullish.optional()
676
693
  });
677
694
  var EnvVar = _zod.z.object({
678
695
  id: _zod.z.string().uuid(),
@@ -752,7 +769,7 @@ var ExperimentEvent = _zod.z.object({
752
769
  root_span_id: _zod.z.string(),
753
770
  span_attributes: SpanAttributes.optional(),
754
771
  is_root: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional(),
755
- origin: ObjectReference.optional()
772
+ origin: ObjectReferenceNullish.optional()
756
773
  });
757
774
  var ExtendedSavedFunctionId = _zod.z.union([
758
775
  _zod.z.object({ type: _zod.z.literal("function"), id: _zod.z.string() }),
@@ -781,7 +798,7 @@ var ModelParams = _zod.z.union([
781
798
  max_completion_tokens: _zod.z.number(),
782
799
  frequency_penalty: _zod.z.number(),
783
800
  presence_penalty: _zod.z.number(),
784
- response_format: ResponseFormat,
801
+ response_format: ResponseFormatNullish,
785
802
  tool_choice: _zod.z.union([
786
803
  _zod.z.literal("auto"),
787
804
  _zod.z.literal("none"),
@@ -1104,6 +1121,20 @@ var MessageRole = _zod.z.enum([
1104
1121
  "model",
1105
1122
  "developer"
1106
1123
  ]);
1124
+ var ObjectReference = _zod.z.object({
1125
+ object_type: _zod.z.enum([
1126
+ "project_logs",
1127
+ "experiment",
1128
+ "dataset",
1129
+ "prompt",
1130
+ "function",
1131
+ "prompt_session"
1132
+ ]),
1133
+ object_id: _zod.z.string().uuid(),
1134
+ id: _zod.z.string(),
1135
+ _xact_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1136
+ created: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional()
1137
+ });
1107
1138
  var OnlineScoreConfig = _zod.z.union([
1108
1139
  _zod.z.object({
1109
1140
  sampling_rate: _zod.z.number().gte(0).lte(1),
@@ -1236,7 +1267,7 @@ var ProjectLogsEvent = _zod.z.object({
1236
1267
  root_span_id: _zod.z.string(),
1237
1268
  is_root: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional(),
1238
1269
  span_attributes: SpanAttributes.optional(),
1239
- origin: ObjectReference.optional()
1270
+ origin: ObjectReferenceNullish.optional()
1240
1271
  });
1241
1272
  var ProjectScoreType = _zod.z.enum([
1242
1273
  "slider",
@@ -1318,6 +1349,14 @@ var PromptSessionEvent = _zod.z.object({
1318
1349
  completion: _zod.z.unknown().optional(),
1319
1350
  tags: _zod.z.union([_zod.z.array(_zod.z.string()), _zod.z.null()]).optional()
1320
1351
  });
1352
+ var ResponseFormat = _zod.z.union([
1353
+ _zod.z.object({ type: _zod.z.literal("json_object") }),
1354
+ _zod.z.object({
1355
+ type: _zod.z.literal("json_schema"),
1356
+ json_schema: ResponseFormatJsonSchema
1357
+ }),
1358
+ _zod.z.object({ type: _zod.z.literal("text") })
1359
+ ]);
1321
1360
  var Role = _zod.z.object({
1322
1361
  id: _zod.z.string().uuid(),
1323
1362
  org_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
@@ -1377,10 +1416,9 @@ var ServiceToken = _zod.z.object({
1377
1416
  created: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1378
1417
  name: _zod.z.string(),
1379
1418
  preview_name: _zod.z.string(),
1380
- user_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1381
- user_email: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1382
- user_given_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1383
- user_family_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1419
+ service_account_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1420
+ service_account_email: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1421
+ service_account_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1384
1422
  org_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional()
1385
1423
  });
1386
1424
  var SpanIFrame = _zod.z.object({
@@ -1401,7 +1439,7 @@ var SSEConsoleEventData = _zod.z.object({
1401
1439
  var SSEProgressEventData = _zod.z.object({
1402
1440
  id: _zod.z.string(),
1403
1441
  object_type: FunctionObjectType,
1404
- origin: ObjectReference.and(_zod.z.unknown()).optional(),
1442
+ origin: ObjectReferenceNullish.and(_zod.z.unknown()).optional(),
1405
1443
  format: FunctionFormat,
1406
1444
  output_type: FunctionOutputType,
1407
1445
  name: _zod.z.string(),
@@ -382,7 +382,7 @@ var ResponseFormatJsonSchema = z.object({
382
382
  schema: z.union([z.object({}).partial().passthrough(), z.string()]).optional(),
383
383
  strict: z.union([z.boolean(), z.null()]).optional()
384
384
  });
385
- var ResponseFormat = z.union([
385
+ var ResponseFormatNullish = z.union([
386
386
  z.object({ type: z.literal("json_object") }),
387
387
  z.object({
388
388
  type: z.literal("json_schema"),
@@ -398,7 +398,7 @@ var AnyModelParams = z.object({
398
398
  max_completion_tokens: z.number().optional(),
399
399
  frequency_penalty: z.number().optional(),
400
400
  presence_penalty: z.number().optional(),
401
- response_format: ResponseFormat.optional(),
401
+ response_format: ResponseFormatNullish.optional(),
402
402
  tool_choice: z.union([
403
403
  z.literal("auto"),
404
404
  z.literal("none"),
@@ -436,6 +436,23 @@ var ApiKey = z.object({
436
436
  user_family_name: z.union([z.string(), z.null()]).optional(),
437
437
  org_id: z.union([z.string(), z.null()]).optional()
438
438
  });
439
+ var AsyncScoringState = z.union([
440
+ z.object({
441
+ status: z.literal("enabled"),
442
+ token: z.string(),
443
+ function_ids: z.array(z.unknown()).min(1),
444
+ skip_logging: z.union([z.boolean(), z.null()]).optional()
445
+ }),
446
+ z.object({ status: z.literal("disabled") }),
447
+ z.null(),
448
+ z.null()
449
+ ]);
450
+ var AsyncScoringControl = z.union([
451
+ z.object({ kind: z.literal("score_update"), token: z.string() }),
452
+ z.object({ kind: z.literal("state_override"), state: AsyncScoringState }),
453
+ z.object({ kind: z.literal("state_force_reselect") }),
454
+ z.object({ kind: z.literal("state_enabled_force_rescore") })
455
+ ]);
439
456
  var BraintrustAttachmentReference = z.object({
440
457
  type: z.literal("braintrust_attachment"),
441
458
  filename: z.string().min(1),
@@ -638,7 +655,7 @@ var Dataset = z.object({
638
655
  user_id: z.union([z.string(), z.null()]).optional(),
639
656
  metadata: z.union([z.object({}).partial().passthrough(), z.null()]).optional()
640
657
  });
641
- var ObjectReference = z.union([
658
+ var ObjectReferenceNullish = z.union([
642
659
  z.object({
643
660
  object_type: z.enum([
644
661
  "project_logs",
@@ -672,7 +689,7 @@ var DatasetEvent = z.object({
672
689
  span_id: z.string(),
673
690
  root_span_id: z.string(),
674
691
  is_root: z.union([z.boolean(), z.null()]).optional(),
675
- origin: ObjectReference.optional()
692
+ origin: ObjectReferenceNullish.optional()
676
693
  });
677
694
  var EnvVar = z.object({
678
695
  id: z.string().uuid(),
@@ -752,7 +769,7 @@ var ExperimentEvent = z.object({
752
769
  root_span_id: z.string(),
753
770
  span_attributes: SpanAttributes.optional(),
754
771
  is_root: z.union([z.boolean(), z.null()]).optional(),
755
- origin: ObjectReference.optional()
772
+ origin: ObjectReferenceNullish.optional()
756
773
  });
757
774
  var ExtendedSavedFunctionId = z.union([
758
775
  z.object({ type: z.literal("function"), id: z.string() }),
@@ -781,7 +798,7 @@ var ModelParams = z.union([
781
798
  max_completion_tokens: z.number(),
782
799
  frequency_penalty: z.number(),
783
800
  presence_penalty: z.number(),
784
- response_format: ResponseFormat,
801
+ response_format: ResponseFormatNullish,
785
802
  tool_choice: z.union([
786
803
  z.literal("auto"),
787
804
  z.literal("none"),
@@ -1104,6 +1121,20 @@ var MessageRole = z.enum([
1104
1121
  "model",
1105
1122
  "developer"
1106
1123
  ]);
1124
+ var ObjectReference = z.object({
1125
+ object_type: z.enum([
1126
+ "project_logs",
1127
+ "experiment",
1128
+ "dataset",
1129
+ "prompt",
1130
+ "function",
1131
+ "prompt_session"
1132
+ ]),
1133
+ object_id: z.string().uuid(),
1134
+ id: z.string(),
1135
+ _xact_id: z.union([z.string(), z.null()]).optional(),
1136
+ created: z.union([z.string(), z.null()]).optional()
1137
+ });
1107
1138
  var OnlineScoreConfig = z.union([
1108
1139
  z.object({
1109
1140
  sampling_rate: z.number().gte(0).lte(1),
@@ -1236,7 +1267,7 @@ var ProjectLogsEvent = z.object({
1236
1267
  root_span_id: z.string(),
1237
1268
  is_root: z.union([z.boolean(), z.null()]).optional(),
1238
1269
  span_attributes: SpanAttributes.optional(),
1239
- origin: ObjectReference.optional()
1270
+ origin: ObjectReferenceNullish.optional()
1240
1271
  });
1241
1272
  var ProjectScoreType = z.enum([
1242
1273
  "slider",
@@ -1318,6 +1349,14 @@ var PromptSessionEvent = z.object({
1318
1349
  completion: z.unknown().optional(),
1319
1350
  tags: z.union([z.array(z.string()), z.null()]).optional()
1320
1351
  });
1352
+ var ResponseFormat = z.union([
1353
+ z.object({ type: z.literal("json_object") }),
1354
+ z.object({
1355
+ type: z.literal("json_schema"),
1356
+ json_schema: ResponseFormatJsonSchema
1357
+ }),
1358
+ z.object({ type: z.literal("text") })
1359
+ ]);
1321
1360
  var Role = z.object({
1322
1361
  id: z.string().uuid(),
1323
1362
  org_id: z.union([z.string(), z.null()]).optional(),
@@ -1377,10 +1416,9 @@ var ServiceToken = z.object({
1377
1416
  created: z.union([z.string(), z.null()]).optional(),
1378
1417
  name: z.string(),
1379
1418
  preview_name: z.string(),
1380
- user_id: z.union([z.string(), z.null()]).optional(),
1381
- user_email: z.union([z.string(), z.null()]).optional(),
1382
- user_given_name: z.union([z.string(), z.null()]).optional(),
1383
- user_family_name: z.union([z.string(), z.null()]).optional(),
1419
+ service_account_id: z.union([z.string(), z.null()]).optional(),
1420
+ service_account_email: z.union([z.string(), z.null()]).optional(),
1421
+ service_account_name: z.union([z.string(), z.null()]).optional(),
1384
1422
  org_id: z.union([z.string(), z.null()]).optional()
1385
1423
  });
1386
1424
  var SpanIFrame = z.object({
@@ -1401,7 +1439,7 @@ var SSEConsoleEventData = z.object({
1401
1439
  var SSEProgressEventData = z.object({
1402
1440
  id: z.string(),
1403
1441
  object_type: FunctionObjectType,
1404
- origin: ObjectReference.and(z.unknown()).optional(),
1442
+ origin: ObjectReferenceNullish.and(z.unknown()).optional(),
1405
1443
  format: FunctionFormat,
1406
1444
  output_type: FunctionOutputType,
1407
1445
  name: z.string(),
@@ -1124,26 +1124,6 @@ declare const ChatCompletionTool: z.ZodObject<{
1124
1124
  type: "function";
1125
1125
  }>;
1126
1126
  type ChatCompletionToolType = z.infer<typeof ChatCompletionTool>;
1127
- declare const ObjectReference: z.ZodUnion<[z.ZodObject<{
1128
- object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
1129
- object_id: z.ZodString;
1130
- id: z.ZodString;
1131
- _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1132
- created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1133
- }, "strip", z.ZodTypeAny, {
1134
- id: string;
1135
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
1136
- object_id: string;
1137
- created?: string | null | undefined;
1138
- _xact_id?: string | null | undefined;
1139
- }, {
1140
- id: string;
1141
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
1142
- object_id: string;
1143
- created?: string | null | undefined;
1144
- _xact_id?: string | null | undefined;
1145
- }>, z.ZodNull]>;
1146
- type ObjectReferenceType = z.infer<typeof ObjectReference>;
1147
1127
  declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
1148
1128
  commit: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1149
1129
  branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
@@ -5211,6 +5191,26 @@ declare const IfExists: z.ZodEnum<["error", "ignore", "replace"]>;
5211
5191
  type IfExistsType = z.infer<typeof IfExists>;
5212
5192
  declare const StreamingMode: z.ZodUnion<[z.ZodEnum<["auto", "parallel"]>, z.ZodNull]>;
5213
5193
  type StreamingModeType = z.infer<typeof StreamingMode>;
5194
+ declare const ObjectReference: z.ZodObject<{
5195
+ object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
5196
+ object_id: z.ZodString;
5197
+ id: z.ZodString;
5198
+ _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
5199
+ created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
5200
+ }, "strip", z.ZodTypeAny, {
5201
+ id: string;
5202
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
5203
+ object_id: string;
5204
+ created?: string | null | undefined;
5205
+ _xact_id?: string | null | undefined;
5206
+ }, {
5207
+ id: string;
5208
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
5209
+ object_id: string;
5210
+ created?: string | null | undefined;
5211
+ _xact_id?: string | null | undefined;
5212
+ }>;
5213
+ type ObjectReferenceType = z.infer<typeof ObjectReference>;
5214
5214
  declare const Prompt$1: z.ZodObject<{
5215
5215
  id: z.ZodString;
5216
5216
  _xact_id: z.ZodString;
package/dist/browser.d.ts CHANGED
@@ -1124,26 +1124,6 @@ declare const ChatCompletionTool: z.ZodObject<{
1124
1124
  type: "function";
1125
1125
  }>;
1126
1126
  type ChatCompletionToolType = z.infer<typeof ChatCompletionTool>;
1127
- declare const ObjectReference: z.ZodUnion<[z.ZodObject<{
1128
- object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
1129
- object_id: z.ZodString;
1130
- id: z.ZodString;
1131
- _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1132
- created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1133
- }, "strip", z.ZodTypeAny, {
1134
- id: string;
1135
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
1136
- object_id: string;
1137
- created?: string | null | undefined;
1138
- _xact_id?: string | null | undefined;
1139
- }, {
1140
- id: string;
1141
- object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
1142
- object_id: string;
1143
- created?: string | null | undefined;
1144
- _xact_id?: string | null | undefined;
1145
- }>, z.ZodNull]>;
1146
- type ObjectReferenceType = z.infer<typeof ObjectReference>;
1147
1127
  declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
1148
1128
  commit: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
1149
1129
  branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
@@ -5211,6 +5191,26 @@ declare const IfExists: z.ZodEnum<["error", "ignore", "replace"]>;
5211
5191
  type IfExistsType = z.infer<typeof IfExists>;
5212
5192
  declare const StreamingMode: z.ZodUnion<[z.ZodEnum<["auto", "parallel"]>, z.ZodNull]>;
5213
5193
  type StreamingModeType = z.infer<typeof StreamingMode>;
5194
+ declare const ObjectReference: z.ZodObject<{
5195
+ object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
5196
+ object_id: z.ZodString;
5197
+ id: z.ZodString;
5198
+ _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
5199
+ created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
5200
+ }, "strip", z.ZodTypeAny, {
5201
+ id: string;
5202
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
5203
+ object_id: string;
5204
+ created?: string | null | undefined;
5205
+ _xact_id?: string | null | undefined;
5206
+ }, {
5207
+ id: string;
5208
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
5209
+ object_id: string;
5210
+ created?: string | null | undefined;
5211
+ _xact_id?: string | null | undefined;
5212
+ }>;
5213
+ type ObjectReferenceType = z.infer<typeof ObjectReference>;
5214
5214
  declare const Prompt$1: z.ZodObject<{
5215
5215
  id: z.ZodString;
5216
5216
  _xact_id: z.ZodString;
package/dist/browser.js CHANGED
@@ -166,7 +166,7 @@ var ResponseFormatJsonSchema = _zod.z.object({
166
166
  schema: _zod.z.union([_zod.z.object({}).partial().passthrough(), _zod.z.string()]).optional(),
167
167
  strict: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional()
168
168
  });
169
- var ResponseFormat = _zod.z.union([
169
+ var ResponseFormatNullish = _zod.z.union([
170
170
  _zod.z.object({ type: _zod.z.literal("json_object") }),
171
171
  _zod.z.object({
172
172
  type: _zod.z.literal("json_schema"),
@@ -182,7 +182,7 @@ var AnyModelParams = _zod.z.object({
182
182
  max_completion_tokens: _zod.z.number().optional(),
183
183
  frequency_penalty: _zod.z.number().optional(),
184
184
  presence_penalty: _zod.z.number().optional(),
185
- response_format: ResponseFormat.optional(),
185
+ response_format: ResponseFormatNullish.optional(),
186
186
  tool_choice: _zod.z.union([
187
187
  _zod.z.literal("auto"),
188
188
  _zod.z.literal("none"),
@@ -220,6 +220,23 @@ var ApiKey = _zod.z.object({
220
220
  user_family_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
221
221
  org_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional()
222
222
  });
223
+ var AsyncScoringState = _zod.z.union([
224
+ _zod.z.object({
225
+ status: _zod.z.literal("enabled"),
226
+ token: _zod.z.string(),
227
+ function_ids: _zod.z.array(_zod.z.unknown()).min(1),
228
+ skip_logging: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional()
229
+ }),
230
+ _zod.z.object({ status: _zod.z.literal("disabled") }),
231
+ _zod.z.null(),
232
+ _zod.z.null()
233
+ ]);
234
+ var AsyncScoringControl = _zod.z.union([
235
+ _zod.z.object({ kind: _zod.z.literal("score_update"), token: _zod.z.string() }),
236
+ _zod.z.object({ kind: _zod.z.literal("state_override"), state: AsyncScoringState }),
237
+ _zod.z.object({ kind: _zod.z.literal("state_force_reselect") }),
238
+ _zod.z.object({ kind: _zod.z.literal("state_enabled_force_rescore") })
239
+ ]);
223
240
  var BraintrustAttachmentReference = _zod.z.object({
224
241
  type: _zod.z.literal("braintrust_attachment"),
225
242
  filename: _zod.z.string().min(1),
@@ -422,7 +439,7 @@ var Dataset = _zod.z.object({
422
439
  user_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
423
440
  metadata: _zod.z.union([_zod.z.object({}).partial().passthrough(), _zod.z.null()]).optional()
424
441
  });
425
- var ObjectReference = _zod.z.union([
442
+ var ObjectReferenceNullish = _zod.z.union([
426
443
  _zod.z.object({
427
444
  object_type: _zod.z.enum([
428
445
  "project_logs",
@@ -456,7 +473,7 @@ var DatasetEvent = _zod.z.object({
456
473
  span_id: _zod.z.string(),
457
474
  root_span_id: _zod.z.string(),
458
475
  is_root: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional(),
459
- origin: ObjectReference.optional()
476
+ origin: ObjectReferenceNullish.optional()
460
477
  });
461
478
  var EnvVar = _zod.z.object({
462
479
  id: _zod.z.string().uuid(),
@@ -536,7 +553,7 @@ var ExperimentEvent = _zod.z.object({
536
553
  root_span_id: _zod.z.string(),
537
554
  span_attributes: SpanAttributes.optional(),
538
555
  is_root: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional(),
539
- origin: ObjectReference.optional()
556
+ origin: ObjectReferenceNullish.optional()
540
557
  });
541
558
  var ExtendedSavedFunctionId = _zod.z.union([
542
559
  _zod.z.object({ type: _zod.z.literal("function"), id: _zod.z.string() }),
@@ -565,7 +582,7 @@ var ModelParams = _zod.z.union([
565
582
  max_completion_tokens: _zod.z.number(),
566
583
  frequency_penalty: _zod.z.number(),
567
584
  presence_penalty: _zod.z.number(),
568
- response_format: ResponseFormat,
585
+ response_format: ResponseFormatNullish,
569
586
  tool_choice: _zod.z.union([
570
587
  _zod.z.literal("auto"),
571
588
  _zod.z.literal("none"),
@@ -888,6 +905,20 @@ var MessageRole = _zod.z.enum([
888
905
  "model",
889
906
  "developer"
890
907
  ]);
908
+ var ObjectReference = _zod.z.object({
909
+ object_type: _zod.z.enum([
910
+ "project_logs",
911
+ "experiment",
912
+ "dataset",
913
+ "prompt",
914
+ "function",
915
+ "prompt_session"
916
+ ]),
917
+ object_id: _zod.z.string().uuid(),
918
+ id: _zod.z.string(),
919
+ _xact_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
920
+ created: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional()
921
+ });
891
922
  var OnlineScoreConfig = _zod.z.union([
892
923
  _zod.z.object({
893
924
  sampling_rate: _zod.z.number().gte(0).lte(1),
@@ -1020,7 +1051,7 @@ var ProjectLogsEvent = _zod.z.object({
1020
1051
  root_span_id: _zod.z.string(),
1021
1052
  is_root: _zod.z.union([_zod.z.boolean(), _zod.z.null()]).optional(),
1022
1053
  span_attributes: SpanAttributes.optional(),
1023
- origin: ObjectReference.optional()
1054
+ origin: ObjectReferenceNullish.optional()
1024
1055
  });
1025
1056
  var ProjectScoreType = _zod.z.enum([
1026
1057
  "slider",
@@ -1102,6 +1133,14 @@ var PromptSessionEvent = _zod.z.object({
1102
1133
  completion: _zod.z.unknown().optional(),
1103
1134
  tags: _zod.z.union([_zod.z.array(_zod.z.string()), _zod.z.null()]).optional()
1104
1135
  });
1136
+ var ResponseFormat = _zod.z.union([
1137
+ _zod.z.object({ type: _zod.z.literal("json_object") }),
1138
+ _zod.z.object({
1139
+ type: _zod.z.literal("json_schema"),
1140
+ json_schema: ResponseFormatJsonSchema
1141
+ }),
1142
+ _zod.z.object({ type: _zod.z.literal("text") })
1143
+ ]);
1105
1144
  var Role = _zod.z.object({
1106
1145
  id: _zod.z.string().uuid(),
1107
1146
  org_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
@@ -1161,10 +1200,9 @@ var ServiceToken = _zod.z.object({
1161
1200
  created: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1162
1201
  name: _zod.z.string(),
1163
1202
  preview_name: _zod.z.string(),
1164
- user_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1165
- user_email: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1166
- user_given_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1167
- user_family_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1203
+ service_account_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1204
+ service_account_email: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1205
+ service_account_name: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional(),
1168
1206
  org_id: _zod.z.union([_zod.z.string(), _zod.z.null()]).optional()
1169
1207
  });
1170
1208
  var SpanIFrame = _zod.z.object({
@@ -1185,7 +1223,7 @@ var SSEConsoleEventData = _zod.z.object({
1185
1223
  var SSEProgressEventData = _zod.z.object({
1186
1224
  id: _zod.z.string(),
1187
1225
  object_type: FunctionObjectType,
1188
- origin: ObjectReference.and(_zod.z.unknown()).optional(),
1226
+ origin: ObjectReferenceNullish.and(_zod.z.unknown()).optional(),
1189
1227
  format: FunctionFormat,
1190
1228
  output_type: FunctionOutputType,
1191
1229
  name: _zod.z.string(),