braintrust 0.2.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { TRANSACTION_ID_FIELD, TransactionId, ExperimentEvent, DEFAULT_IS_LEGACY_DATASET, DatasetRecord, ExperimentLogFullArgs, ExperimentLogPartialArgs, LogFeedbackFullArgs, SpanType, IdField, BackgroundLogEvent, SpanComponentsV3, SpanObjectTypeV3, Score, CommentEvent, InputField, LogCommentFullArgs, OtherExperimentLogFields, ParentExperimentIds, ParentProjectLogIds } from '@braintrust/core';
2
- export { CommentEvent, DatasetRecord, ExperimentLogFullArgs, ExperimentLogPartialArgs, IdField, InputField, LogCommentFullArgs, LogFeedbackFullArgs, OtherExperimentLogFields, ParentExperimentIds, ParentProjectLogIds } from '@braintrust/core';
3
- import { z } from 'zod';
1
+ import { z } from 'zod/v3';
2
+ import { z as z$1 } from 'zod';
4
3
 
5
4
  declare class LazyValue<T> {
6
5
  private callable;
@@ -15,6 +14,296 @@ declare class LazyValue<T> {
15
14
  get hasSucceeded(): boolean;
16
15
  }
17
16
 
17
+ declare const TRANSACTION_ID_FIELD = "_xact_id";
18
+ declare const IS_MERGE_FIELD = "_is_merge";
19
+ declare const MERGE_PATHS_FIELD = "_merge_paths";
20
+ declare const AUDIT_SOURCE_FIELD = "_audit_source";
21
+ declare const AUDIT_METADATA_FIELD = "_audit_metadata";
22
+ declare const VALID_SOURCES: readonly ["app", "api", "external"];
23
+ type Source = (typeof VALID_SOURCES)[number];
24
+ declare const ASYNC_SCORING_CONTROL_FIELD = "_async_scoring_control";
25
+ declare const SKIP_ASYNC_SCORING_FIELD = "_skip_async_scoring";
26
+ type TransactionId = string;
27
+
28
+ declare const AsyncScoringControl: z.ZodUnion<[z.ZodObject<{
29
+ kind: z.ZodLiteral<"score_update">;
30
+ token: z.ZodString;
31
+ }, "strip", z.ZodTypeAny, {
32
+ token: string;
33
+ kind: "score_update";
34
+ }, {
35
+ token: string;
36
+ kind: "score_update";
37
+ }>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"state_override">;
39
+ state: z.ZodUnion<[z.ZodObject<{
40
+ status: z.ZodLiteral<"enabled">;
41
+ token: z.ZodString;
42
+ function_ids: z.ZodArray<z.ZodUnknown, "many">;
43
+ skip_logging: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ status: "enabled";
46
+ token: string;
47
+ function_ids: unknown[];
48
+ skip_logging?: boolean | null | undefined;
49
+ }, {
50
+ status: "enabled";
51
+ token: string;
52
+ function_ids: unknown[];
53
+ skip_logging?: boolean | null | undefined;
54
+ }>, z.ZodObject<{
55
+ status: z.ZodLiteral<"disabled">;
56
+ }, "strip", z.ZodTypeAny, {
57
+ status: "disabled";
58
+ }, {
59
+ status: "disabled";
60
+ }>, z.ZodNull, z.ZodNull]>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ kind: "state_override";
63
+ state: {
64
+ status: "enabled";
65
+ token: string;
66
+ function_ids: unknown[];
67
+ skip_logging?: boolean | null | undefined;
68
+ } | {
69
+ status: "disabled";
70
+ } | null;
71
+ }, {
72
+ kind: "state_override";
73
+ state: {
74
+ status: "enabled";
75
+ token: string;
76
+ function_ids: unknown[];
77
+ skip_logging?: boolean | null | undefined;
78
+ } | {
79
+ status: "disabled";
80
+ } | null;
81
+ }>, z.ZodObject<{
82
+ kind: z.ZodLiteral<"state_force_reselect">;
83
+ }, "strip", z.ZodTypeAny, {
84
+ kind: "state_force_reselect";
85
+ }, {
86
+ kind: "state_force_reselect";
87
+ }>, z.ZodObject<{
88
+ kind: z.ZodLiteral<"state_enabled_force_rescore">;
89
+ }, "strip", z.ZodTypeAny, {
90
+ kind: "state_enabled_force_rescore";
91
+ }, {
92
+ kind: "state_enabled_force_rescore";
93
+ }>]>;
94
+ type AsyncScoringControlType = z.infer<typeof AsyncScoringControl>;
95
+ declare const ObjectReference$1: z.ZodObject<{
96
+ object_type: z.ZodEnum<["project_logs", "experiment", "dataset", "prompt", "function", "prompt_session"]>;
97
+ object_id: z.ZodString;
98
+ id: z.ZodString;
99
+ _xact_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
100
+ created: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ id: string;
103
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
104
+ object_id: string;
105
+ created?: string | null | undefined;
106
+ _xact_id?: string | null | undefined;
107
+ }, {
108
+ id: string;
109
+ object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
110
+ object_id: string;
111
+ created?: string | null | undefined;
112
+ _xact_id?: string | null | undefined;
113
+ }>;
114
+
115
+ type IdField = {
116
+ id: string;
117
+ };
118
+ type InputField = {
119
+ input: unknown;
120
+ };
121
+ type OtherExperimentLogFields = {
122
+ output: unknown;
123
+ expected: unknown;
124
+ error: unknown;
125
+ tags: string[];
126
+ scores: Record<string, number | null>;
127
+ metadata: Record<string, unknown>;
128
+ metrics: Record<string, unknown>;
129
+ datasetRecordId: string;
130
+ origin: z.infer<typeof ObjectReference$1>;
131
+ span_attributes: Record<string, unknown>;
132
+ [ASYNC_SCORING_CONTROL_FIELD]: AsyncScoringControlType;
133
+ [MERGE_PATHS_FIELD]: string[][];
134
+ [SKIP_ASYNC_SCORING_FIELD]: boolean;
135
+ };
136
+ type ExperimentLogPartialArgs = Partial<OtherExperimentLogFields> & Partial<InputField>;
137
+ type ExperimentLogFullArgs = Partial<Omit<OtherExperimentLogFields, "output" | "scores">> & Required<Pick<OtherExperimentLogFields, "output" | "scores">> & Partial<InputField> & Partial<IdField>;
138
+ type LogFeedbackFullArgs = IdField & Partial<Omit<OtherExperimentLogFields, "output" | "metrics" | "datasetRecordId"> & {
139
+ comment: string;
140
+ source: Source;
141
+ }>;
142
+ interface ParentExperimentIds {
143
+ experiment_id: string;
144
+ }
145
+ interface ParentProjectLogIds {
146
+ project_id: string;
147
+ log_id: "g";
148
+ }
149
+ interface ParentPlaygroundLogIds {
150
+ prompt_session_id: string;
151
+ log_id: "x";
152
+ }
153
+ type LogCommentFullArgs = IdField & {
154
+ created: string;
155
+ origin: {
156
+ id: string;
157
+ };
158
+ comment: {
159
+ text: string;
160
+ };
161
+ [AUDIT_SOURCE_FIELD]: Source;
162
+ [AUDIT_METADATA_FIELD]?: Record<string, unknown>;
163
+ } & (ParentExperimentIds | ParentProjectLogIds);
164
+ type ExperimentEvent = Partial<InputField> & Partial<OtherExperimentLogFields> & {
165
+ id: string;
166
+ span_id?: string;
167
+ root_span_id?: string;
168
+ experiment_id: string;
169
+ [IS_MERGE_FIELD]: boolean;
170
+ } & Partial<{
171
+ created: string;
172
+ span_parents: string[];
173
+ span_attributes: Record<string, unknown>;
174
+ context: Record<string, unknown>;
175
+ [AUDIT_SOURCE_FIELD]: Source;
176
+ [AUDIT_METADATA_FIELD]?: Record<string, unknown>;
177
+ }>;
178
+ type DatasetEvent = {
179
+ input?: unknown;
180
+ tags?: string[];
181
+ metadata?: unknown;
182
+ created?: string;
183
+ id: string;
184
+ dataset_id: string;
185
+ } & ({
186
+ expected?: unknown;
187
+ } | {
188
+ output?: unknown;
189
+ });
190
+ type LoggingEvent = Omit<ExperimentEvent, "experiment_id"> & {
191
+ project_id: string;
192
+ log_id: "g";
193
+ };
194
+ type PlaygroundLogEvent = Omit<ExperimentEvent, "experiment_id"> & {
195
+ prompt_session_id: string;
196
+ log_id: "x";
197
+ };
198
+ type CommentEvent = IdField & {
199
+ created: string;
200
+ origin: {
201
+ id: string;
202
+ };
203
+ comment: {
204
+ text: string;
205
+ };
206
+ [AUDIT_SOURCE_FIELD]: Source;
207
+ [AUDIT_METADATA_FIELD]?: Record<string, unknown>;
208
+ } & (ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds);
209
+ type BackgroundLogEvent = ExperimentEvent | DatasetEvent | LoggingEvent | PlaygroundLogEvent | CommentEvent;
210
+ declare const DEFAULT_IS_LEGACY_DATASET = false;
211
+ interface LegacyDatasetRecord {
212
+ id: string;
213
+ input: any;
214
+ output: any;
215
+ metadata: any;
216
+ }
217
+ interface NewDatasetRecord {
218
+ id: string;
219
+ input: any;
220
+ expected: any;
221
+ tags: any;
222
+ metadata: any;
223
+ }
224
+ type DatasetRecord<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = IsLegacyDataset extends true ? LegacyDatasetRecord : NewDatasetRecord;
225
+
226
+ declare enum SpanObjectTypeV3 {
227
+ EXPERIMENT = 1,
228
+ PROJECT_LOGS = 2,
229
+ PLAYGROUND_LOGS = 3
230
+ }
231
+ declare const spanComponentsV3Schema: z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
232
+ object_type: z.ZodNativeEnum<typeof SpanObjectTypeV3>;
233
+ propagated_event: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ object_type: SpanObjectTypeV3;
236
+ propagated_event?: Record<string, unknown> | null | undefined;
237
+ }, {
238
+ object_type: SpanObjectTypeV3;
239
+ propagated_event?: Record<string, unknown> | null | undefined;
240
+ }>, z.ZodUnion<[z.ZodObject<{
241
+ object_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
242
+ compute_object_metadata_args: z.ZodOptional<z.ZodNull>;
243
+ }, "strip", z.ZodTypeAny, {
244
+ object_id?: string | null | undefined;
245
+ compute_object_metadata_args?: null | undefined;
246
+ }, {
247
+ object_id?: string | null | undefined;
248
+ compute_object_metadata_args?: null | undefined;
249
+ }>, z.ZodObject<{
250
+ object_id: z.ZodOptional<z.ZodNull>;
251
+ compute_object_metadata_args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
252
+ }, "strip", z.ZodTypeAny, {
253
+ compute_object_metadata_args: Record<string, unknown>;
254
+ object_id?: null | undefined;
255
+ }, {
256
+ compute_object_metadata_args: Record<string, unknown>;
257
+ object_id?: null | undefined;
258
+ }>]>>, z.ZodUnion<[z.ZodObject<{
259
+ row_id: z.ZodString;
260
+ span_id: z.ZodString;
261
+ root_span_id: z.ZodString;
262
+ }, "strip", z.ZodTypeAny, {
263
+ span_id: string;
264
+ root_span_id: string;
265
+ row_id: string;
266
+ }, {
267
+ span_id: string;
268
+ root_span_id: string;
269
+ row_id: string;
270
+ }>, z.ZodObject<{
271
+ row_id: z.ZodOptional<z.ZodNull>;
272
+ span_id: z.ZodOptional<z.ZodNull>;
273
+ root_span_id: z.ZodOptional<z.ZodNull>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ span_id?: null | undefined;
276
+ root_span_id?: null | undefined;
277
+ row_id?: null | undefined;
278
+ }, {
279
+ span_id?: null | undefined;
280
+ root_span_id?: null | undefined;
281
+ row_id?: null | undefined;
282
+ }>]>>;
283
+ type SpanComponentsV3Data = z.infer<typeof spanComponentsV3Schema>;
284
+ declare class SpanComponentsV3 {
285
+ data: SpanComponentsV3Data;
286
+ constructor(data: SpanComponentsV3Data);
287
+ toStr(): string;
288
+ static fromStr(s: string): SpanComponentsV3;
289
+ objectIdFields(): ParentExperimentIds | ParentProjectLogIds | ParentPlaygroundLogIds;
290
+ export(): Promise<string>;
291
+ private static fromJsonObj;
292
+ }
293
+
294
+ interface Score {
295
+ name: string;
296
+ score: number | null;
297
+ metadata?: Record<string, unknown>;
298
+ /**
299
+ * @deprecated
300
+ */
301
+ error?: unknown;
302
+ }
303
+
304
+ declare const spanTypeAttributeValues: readonly ["llm", "score", "function", "eval", "task", "tool"];
305
+ type SpanType = (typeof spanTypeAttributeValues)[number];
306
+
18
307
  declare const AnyModelParams: z.ZodObject<{
19
308
  temperature: z.ZodOptional<z.ZodNumber>;
20
309
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -7748,25 +8037,25 @@ declare const NOOP_SPAN_PERMALINK = "https://braintrust.dev/noop-span";
7748
8037
  declare global {
7749
8038
  var __inherited_braintrust_state: BraintrustState;
7750
8039
  }
7751
- declare const loginSchema: z.ZodObject<{
7752
- appUrl: z.ZodString;
7753
- appPublicUrl: z.ZodString;
7754
- orgName: z.ZodString;
7755
- apiUrl: z.ZodString;
7756
- proxyUrl: z.ZodString;
7757
- loginToken: z.ZodString;
7758
- orgId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7759
- gitMetadataSettings: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7760
- collect: z.ZodEnum<["all", "none", "some"]>;
7761
- fields: z.ZodOptional<z.ZodArray<z.ZodEnum<["commit", "branch", "tag", "dirty", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
7762
- }, "strip", z.ZodTypeAny, {
8040
+ declare const loginSchema: z$1.ZodObject<{
8041
+ appUrl: z$1.ZodString;
8042
+ appPublicUrl: z$1.ZodString;
8043
+ orgName: z$1.ZodString;
8044
+ apiUrl: z$1.ZodString;
8045
+ proxyUrl: z$1.ZodString;
8046
+ loginToken: z$1.ZodString;
8047
+ orgId: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
8048
+ gitMetadataSettings: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodObject<{
8049
+ collect: z$1.ZodEnum<["all", "none", "some"]>;
8050
+ fields: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<["commit", "branch", "tag", "dirty", "author_name", "author_email", "commit_message", "commit_time", "git_diff"]>, "many">>;
8051
+ }, "strip", z$1.ZodTypeAny, {
7763
8052
  collect: "some" | "none" | "all";
7764
8053
  fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
7765
8054
  }, {
7766
8055
  collect: "some" | "none" | "all";
7767
8056
  fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
7768
8057
  }>>>;
7769
- }, "strict", z.ZodTypeAny, {
8058
+ }, "strict", z$1.ZodTypeAny, {
7770
8059
  appUrl: string;
7771
8060
  appPublicUrl: string;
7772
8061
  orgName: string;
@@ -7791,7 +8080,7 @@ declare const loginSchema: z.ZodObject<{
7791
8080
  fields?: ("dirty" | "commit" | "branch" | "tag" | "author_name" | "author_email" | "commit_message" | "commit_time" | "git_diff")[] | undefined;
7792
8081
  } | null | undefined;
7793
8082
  }>;
7794
- type SerializedBraintrustState = z.infer<typeof loginSchema>;
8083
+ type SerializedBraintrustState = z$1.infer<typeof loginSchema>;
7795
8084
  declare class BraintrustState {
7796
8085
  private loginParams;
7797
8086
  id: string;
@@ -8024,19 +8313,19 @@ declare class ExternalAttachment extends BaseAttachment {
8024
8313
  debugInfo(): Record<string, unknown>;
8025
8314
  private initData;
8026
8315
  }
8027
- declare const attachmentMetadataSchema: z.ZodObject<{
8028
- downloadUrl: z.ZodString;
8029
- status: z.ZodObject<{
8030
- upload_status: z.ZodEnum<["uploading", "done", "error"]>;
8031
- error_message: z.ZodOptional<z.ZodString>;
8032
- }, "strip", z.ZodTypeAny, {
8316
+ declare const attachmentMetadataSchema: z$1.ZodObject<{
8317
+ downloadUrl: z$1.ZodString;
8318
+ status: z$1.ZodObject<{
8319
+ upload_status: z$1.ZodEnum<["uploading", "done", "error"]>;
8320
+ error_message: z$1.ZodOptional<z$1.ZodString>;
8321
+ }, "strip", z$1.ZodTypeAny, {
8033
8322
  upload_status: "uploading" | "done" | "error";
8034
8323
  error_message?: string | undefined;
8035
8324
  }, {
8036
8325
  upload_status: "uploading" | "done" | "error";
8037
8326
  error_message?: string | undefined;
8038
8327
  }>;
8039
- }, "strip", z.ZodTypeAny, {
8328
+ }, "strip", z$1.ZodTypeAny, {
8040
8329
  status: {
8041
8330
  upload_status: "uploading" | "done" | "error";
8042
8331
  error_message?: string | undefined;
@@ -8049,7 +8338,7 @@ declare const attachmentMetadataSchema: z.ZodObject<{
8049
8338
  };
8050
8339
  downloadUrl: string;
8051
8340
  }>;
8052
- type AttachmentMetadata = z.infer<typeof attachmentMetadataSchema>;
8341
+ type AttachmentMetadata = z$1.infer<typeof attachmentMetadataSchema>;
8053
8342
  /**
8054
8343
  * A readonly alternative to `Attachment`, which can be used for fetching
8055
8344
  * already-uploaded Attachments.
@@ -8538,8 +8827,11 @@ declare function currentLogger<IsAsyncFlush extends boolean>(options?: AsyncFlus
8538
8827
  declare function currentSpan(options?: OptionalStateArg): Span;
8539
8828
  /**
8540
8829
  * Mainly for internal use. Return the parent object for starting a span in a global context.
8830
+ * Applies precedence: current span > propagated parent string > experiment > logger.
8541
8831
  */
8542
- declare function getSpanParentObject<IsAsyncFlush extends boolean>(options?: AsyncFlushArg<IsAsyncFlush> & OptionalStateArg): Span | Experiment | Logger<IsAsyncFlush>;
8832
+ declare function getSpanParentObject<IsAsyncFlush extends boolean>(options?: AsyncFlushArg<IsAsyncFlush> & OptionalStateArg & {
8833
+ parent?: string;
8834
+ }): SpanComponentsV3 | Span | Experiment | Logger<IsAsyncFlush>;
8543
8835
  declare function logError(span: Span, error: unknown): void;
8544
8836
  /**
8545
8837
  * Toplevel function for starting a span. It checks the following (in precedence order):
@@ -19583,14 +19875,14 @@ type braintrust_BraintrustStream = BraintrustStream;
19583
19875
  declare const braintrust_BraintrustStream: typeof BraintrustStream;
19584
19876
  type braintrust_BraintrustStreamChunk = BraintrustStreamChunk;
19585
19877
  type braintrust_ChatPrompt = ChatPrompt;
19586
- declare const braintrust_CommentEvent: typeof CommentEvent;
19878
+ type braintrust_CommentEvent = CommentEvent;
19587
19879
  type braintrust_CompiledPrompt<Flavor extends "chat" | "completion"> = CompiledPrompt<Flavor>;
19588
19880
  type braintrust_CompiledPromptParams = CompiledPromptParams;
19589
19881
  type braintrust_CompletionPrompt = CompletionPrompt;
19590
19882
  type braintrust_DataSummary = DataSummary;
19591
19883
  type braintrust_Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = Dataset<IsLegacyDataset>;
19592
19884
  declare const braintrust_Dataset: typeof Dataset;
19593
- declare const braintrust_DatasetRecord: typeof DatasetRecord;
19885
+ type braintrust_DatasetRecord<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY_DATASET> = DatasetRecord<IsLegacyDataset>;
19594
19886
  type braintrust_DatasetSummary = DatasetSummary;
19595
19887
  type braintrust_DefaultMetadataType = DefaultMetadataType;
19596
19888
  type braintrust_DefaultPromptArgs = DefaultPromptArgs;
@@ -19604,8 +19896,8 @@ type braintrust_EvaluatorDefinitions = EvaluatorDefinitions;
19604
19896
  type braintrust_EvaluatorManifest = EvaluatorManifest;
19605
19897
  type braintrust_Experiment = Experiment;
19606
19898
  declare const braintrust_Experiment: typeof Experiment;
19607
- declare const braintrust_ExperimentLogFullArgs: typeof ExperimentLogFullArgs;
19608
- declare const braintrust_ExperimentLogPartialArgs: typeof ExperimentLogPartialArgs;
19899
+ type braintrust_ExperimentLogFullArgs = ExperimentLogFullArgs;
19900
+ type braintrust_ExperimentLogPartialArgs = ExperimentLogPartialArgs;
19609
19901
  type braintrust_ExperimentSummary = ExperimentSummary;
19610
19902
  type braintrust_Exportable = Exportable;
19611
19903
  type braintrust_ExternalAttachment = ExternalAttachment;
@@ -19616,16 +19908,16 @@ declare const braintrust_FailedHTTPResponse: typeof FailedHTTPResponse;
19616
19908
  type braintrust_FullInitOptions<IsOpen extends boolean> = FullInitOptions<IsOpen>;
19617
19909
  type braintrust_FullLoginOptions = FullLoginOptions;
19618
19910
  declare const braintrust_INTERNAL_BTQL_LIMIT: typeof INTERNAL_BTQL_LIMIT;
19619
- declare const braintrust_IdField: typeof IdField;
19911
+ type braintrust_IdField = IdField;
19620
19912
  type braintrust_InitOptions<IsOpen extends boolean> = InitOptions<IsOpen>;
19621
- declare const braintrust_InputField: typeof InputField;
19913
+ type braintrust_InputField = InputField;
19622
19914
  type braintrust_InvokeFunctionArgs<Input, Output, Stream extends boolean = false> = InvokeFunctionArgs<Input, Output, Stream>;
19623
19915
  type braintrust_InvokeReturn<Stream extends boolean, Output> = InvokeReturn<Stream, Output>;
19624
19916
  declare const braintrust_LEGACY_CACHED_HEADER: typeof LEGACY_CACHED_HEADER;
19625
19917
  type braintrust_LazyValue<T> = LazyValue<T>;
19626
19918
  declare const braintrust_LazyValue: typeof LazyValue;
19627
- declare const braintrust_LogCommentFullArgs: typeof LogCommentFullArgs;
19628
- declare const braintrust_LogFeedbackFullArgs: typeof LogFeedbackFullArgs;
19919
+ type braintrust_LogCommentFullArgs = LogCommentFullArgs;
19920
+ type braintrust_LogFeedbackFullArgs = LogFeedbackFullArgs;
19629
19921
  type braintrust_LogOptions<IsAsyncFlush> = LogOptions<IsAsyncFlush>;
19630
19922
  type braintrust_Logger<IsAsyncFlush extends boolean> = Logger<IsAsyncFlush>;
19631
19923
  declare const braintrust_Logger: typeof Logger;
@@ -19636,9 +19928,9 @@ declare const braintrust_NOOP_SPAN_PERMALINK: typeof NOOP_SPAN_PERMALINK;
19636
19928
  type braintrust_NoopSpan = NoopSpan;
19637
19929
  declare const braintrust_NoopSpan: typeof NoopSpan;
19638
19930
  type braintrust_ObjectMetadata = ObjectMetadata;
19639
- declare const braintrust_OtherExperimentLogFields: typeof OtherExperimentLogFields;
19640
- declare const braintrust_ParentExperimentIds: typeof ParentExperimentIds;
19641
- declare const braintrust_ParentProjectLogIds: typeof ParentProjectLogIds;
19931
+ type braintrust_OtherExperimentLogFields = OtherExperimentLogFields;
19932
+ type braintrust_ParentExperimentIds = ParentExperimentIds;
19933
+ type braintrust_ParentProjectLogIds = ParentProjectLogIds;
19642
19934
  type braintrust_PromiseUnless<B, R> = PromiseUnless<B, R>;
19643
19935
  type braintrust_Prompt<HasId extends boolean = true, HasVersion extends boolean = true> = Prompt<HasId, HasVersion>;
19644
19936
  declare const braintrust_Prompt: typeof Prompt;
@@ -19706,7 +19998,7 @@ declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
19706
19998
  declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
19707
19999
  declare const braintrust_wrapTraced: typeof wrapTraced;
19708
20000
  declare namespace braintrust {
19709
- export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CommentEvent as CommentEvent, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, braintrust_DatasetRecord as DatasetRecord, 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, type braintrust_EvalCase as EvalCase, type braintrust_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type braintrust_EvalParameters as EvalParameters, type braintrust_EvaluatorDefinition as EvaluatorDefinition, type braintrust_EvaluatorDefinitions as EvaluatorDefinitions, type braintrust_EvaluatorManifest as EvaluatorManifest, braintrust_Experiment as Experiment, braintrust_ExperimentLogFullArgs as ExperimentLogFullArgs, braintrust_ExperimentLogPartialArgs as ExperimentLogPartialArgs, 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, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, braintrust_IdField as IdField, type braintrust_InitOptions as InitOptions, braintrust_InputField as InputField, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, braintrust_LogCommentFullArgs as LogCommentFullArgs, braintrust_LogFeedbackFullArgs as LogFeedbackFullArgs, 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_OtherExperimentLogFields as OtherExperimentLogFields, braintrust_ParentExperimentIds as ParentExperimentIds, braintrust_ParentProjectLogIds as ParentProjectLogIds, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, type braintrust_ScoreSummary as ScoreSummary, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type braintrust_Span as Span, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, 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_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_evaluatorDefinitionSchema as evaluatorDefinitionSchema, braintrust_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, braintrust_flush as flush, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, 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_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, 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_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
20001
+ export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, type braintrust_CommentEvent as CommentEvent, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetRecord as DatasetRecord, 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, type braintrust_EvalCase as EvalCase, type braintrust_EvalParameterSerializedSchema as EvalParameterSerializedSchema, type braintrust_EvalParameters as EvalParameters, type braintrust_EvaluatorDefinition as EvaluatorDefinition, type braintrust_EvaluatorDefinitions as EvaluatorDefinitions, type braintrust_EvaluatorManifest as EvaluatorManifest, braintrust_Experiment as Experiment, type braintrust_ExperimentLogFullArgs as ExperimentLogFullArgs, type braintrust_ExperimentLogPartialArgs as ExperimentLogPartialArgs, 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, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_IdField as IdField, type braintrust_InitOptions as InitOptions, type braintrust_InputField as InputField, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogCommentFullArgs as LogCommentFullArgs, type braintrust_LogFeedbackFullArgs as LogFeedbackFullArgs, 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, type braintrust_OtherExperimentLogFields as OtherExperimentLogFields, type braintrust_ParentExperimentIds as ParentExperimentIds, type braintrust_ParentProjectLogIds as ParentProjectLogIds, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, type braintrust_ScoreSummary as ScoreSummary, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type braintrust_Span as Span, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, 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_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_evaluatorDefinitionSchema as evaluatorDefinitionSchema, braintrust_evaluatorDefinitionsSchema as evaluatorDefinitionsSchema, braintrust_flush as flush, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, 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_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, 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_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
19710
20002
  }
19711
20003
 
19712
- export { type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, type BaseMetadata, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type DataSummary, Dataset, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, type EvalCase, type EvalParameterSerializedSchema, type EvalParameters, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorManifest, Experiment, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, 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, type PromiseUnless, Prompt, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type ScoreSummary, type SerializedBraintrustState, type SetCurrentArg, type Span, SpanImpl, type StartSpanArgs, TestBackgroundLogger, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getPromptVersions, getSpanParentObject, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, renderMessage, renderPromptParams, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
20004
+ export { type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, BaseAttachment, type BaseMetadata, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, type EvalCase, type EvalParameterSerializedSchema, type EvalParameters, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, type PromiseUnless, Prompt, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type ScoreSummary, type SerializedBraintrustState, type SetCurrentArg, type Span, SpanImpl, type StartSpanArgs, TestBackgroundLogger, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getPromptVersions, getSpanParentObject, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, renderMessage, renderPromptParams, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapOpenAI, wrapOpenAIv4, wrapTraced };