braintrust 3.9.0 → 3.10.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/dev/dist/index.d.mts +107 -1
- package/dev/dist/index.d.ts +107 -1
- package/dev/dist/index.js +2126 -443
- package/dev/dist/index.mjs +1814 -131
- package/dist/auto-instrumentations/bundler/esbuild.cjs +166 -0
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
- package/dist/auto-instrumentations/bundler/rollup.cjs +166 -0
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +166 -0
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +163 -0
- package/dist/auto-instrumentations/bundler/webpack.cjs +166 -0
- package/dist/auto-instrumentations/bundler/webpack.mjs +2 -2
- package/dist/auto-instrumentations/{chunk-KIMMUFAK.mjs → chunk-GZNXBBPU.mjs} +164 -1
- package/dist/auto-instrumentations/{chunk-G7F6HZGE.mjs → chunk-XWEQQOQH.mjs} +8 -1
- package/dist/auto-instrumentations/hook.mjs +255 -8
- package/dist/auto-instrumentations/index.cjs +256 -7
- package/dist/auto-instrumentations/index.d.mts +5 -1
- package/dist/auto-instrumentations/index.d.ts +5 -1
- package/dist/auto-instrumentations/index.mjs +96 -8
- package/dist/browser.d.mts +141 -7
- package/dist/browser.d.ts +141 -7
- package/dist/browser.js +2035 -140
- package/dist/browser.mjs +2035 -140
- package/dist/cli.js +1822 -139
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +2035 -140
- package/dist/edge-light.mjs +2035 -140
- package/dist/index.d.mts +141 -7
- package/dist/index.d.ts +141 -7
- package/dist/index.js +2397 -502
- package/dist/index.mjs +2035 -140
- package/dist/instrumentation/index.d.mts +7 -0
- package/dist/instrumentation/index.d.ts +7 -0
- package/dist/instrumentation/index.js +1662 -167
- package/dist/instrumentation/index.mjs +1662 -167
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +2035 -140
- package/dist/workerd.mjs +2035 -140
- package/package.json +6 -6
package/dev/dist/index.d.mts
CHANGED
|
@@ -1474,6 +1474,29 @@ declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
1474
1474
|
function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
|
|
1475
1475
|
}>]>;
|
|
1476
1476
|
type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
|
|
1477
|
+
declare const DatasetSnapshot: z.ZodObject<{
|
|
1478
|
+
id: z.ZodString;
|
|
1479
|
+
dataset_id: z.ZodString;
|
|
1480
|
+
name: z.ZodString;
|
|
1481
|
+
description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
|
|
1482
|
+
xact_id: z.ZodString;
|
|
1483
|
+
created: z.ZodUnion<[z.ZodString, z.ZodNull]>;
|
|
1484
|
+
}, "strip", z.ZodTypeAny, {
|
|
1485
|
+
id: string;
|
|
1486
|
+
created: string | null;
|
|
1487
|
+
name: string;
|
|
1488
|
+
description: string | null;
|
|
1489
|
+
dataset_id: string;
|
|
1490
|
+
xact_id: string;
|
|
1491
|
+
}, {
|
|
1492
|
+
id: string;
|
|
1493
|
+
created: string | null;
|
|
1494
|
+
name: string;
|
|
1495
|
+
description: string | null;
|
|
1496
|
+
dataset_id: string;
|
|
1497
|
+
xact_id: string;
|
|
1498
|
+
}>;
|
|
1499
|
+
type DatasetSnapshotType = z.infer<typeof DatasetSnapshot>;
|
|
1477
1500
|
declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
|
|
1478
1501
|
commit: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
1479
1502
|
branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
@@ -4035,6 +4058,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4035
4058
|
hierarchy_threshold?: number | undefined;
|
|
4036
4059
|
naming_model?: string | undefined;
|
|
4037
4060
|
}>>;
|
|
4061
|
+
disable_reconciliation: z.ZodOptional<z.ZodBoolean>;
|
|
4038
4062
|
distance_threshold: z.ZodOptional<z.ZodNumber>;
|
|
4039
4063
|
}, "strip", z.ZodTypeAny, {
|
|
4040
4064
|
type: "topic_map";
|
|
@@ -4053,6 +4077,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4053
4077
|
hierarchy_threshold?: number | undefined;
|
|
4054
4078
|
naming_model?: string | undefined;
|
|
4055
4079
|
} | undefined;
|
|
4080
|
+
disable_reconciliation?: boolean | undefined;
|
|
4056
4081
|
distance_threshold?: number | undefined;
|
|
4057
4082
|
}, {
|
|
4058
4083
|
type: "topic_map";
|
|
@@ -4071,6 +4096,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4071
4096
|
hierarchy_threshold?: number | undefined;
|
|
4072
4097
|
naming_model?: string | undefined;
|
|
4073
4098
|
} | undefined;
|
|
4099
|
+
disable_reconciliation?: boolean | undefined;
|
|
4074
4100
|
distance_threshold?: number | undefined;
|
|
4075
4101
|
}>;
|
|
4076
4102
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4092,6 +4118,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4092
4118
|
hierarchy_threshold?: number | undefined;
|
|
4093
4119
|
naming_model?: string | undefined;
|
|
4094
4120
|
} | undefined;
|
|
4121
|
+
disable_reconciliation?: boolean | undefined;
|
|
4095
4122
|
distance_threshold?: number | undefined;
|
|
4096
4123
|
};
|
|
4097
4124
|
topic_map_id?: string | undefined;
|
|
@@ -4114,6 +4141,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4114
4141
|
hierarchy_threshold?: number | undefined;
|
|
4115
4142
|
naming_model?: string | undefined;
|
|
4116
4143
|
} | undefined;
|
|
4144
|
+
disable_reconciliation?: boolean | undefined;
|
|
4117
4145
|
distance_threshold?: number | undefined;
|
|
4118
4146
|
};
|
|
4119
4147
|
topic_map_id?: string | undefined;
|
|
@@ -4155,6 +4183,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4155
4183
|
hierarchy_threshold?: number | undefined;
|
|
4156
4184
|
naming_model?: string | undefined;
|
|
4157
4185
|
} | undefined;
|
|
4186
|
+
disable_reconciliation?: boolean | undefined;
|
|
4158
4187
|
distance_threshold?: number | undefined;
|
|
4159
4188
|
};
|
|
4160
4189
|
topic_map_id?: string | undefined;
|
|
@@ -4196,6 +4225,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4196
4225
|
hierarchy_threshold?: number | undefined;
|
|
4197
4226
|
naming_model?: string | undefined;
|
|
4198
4227
|
} | undefined;
|
|
4228
|
+
disable_reconciliation?: boolean | undefined;
|
|
4199
4229
|
distance_threshold?: number | undefined;
|
|
4200
4230
|
};
|
|
4201
4231
|
topic_map_id?: string | undefined;
|
|
@@ -4276,6 +4306,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4276
4306
|
hierarchy_threshold?: number | undefined;
|
|
4277
4307
|
naming_model?: string | undefined;
|
|
4278
4308
|
}>>;
|
|
4309
|
+
disable_reconciliation: z.ZodOptional<z.ZodBoolean>;
|
|
4279
4310
|
distance_threshold: z.ZodOptional<z.ZodNumber>;
|
|
4280
4311
|
}, "strip", z.ZodTypeAny, {
|
|
4281
4312
|
type: "topic_map";
|
|
@@ -4294,6 +4325,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4294
4325
|
hierarchy_threshold?: number | undefined;
|
|
4295
4326
|
naming_model?: string | undefined;
|
|
4296
4327
|
} | undefined;
|
|
4328
|
+
disable_reconciliation?: boolean | undefined;
|
|
4297
4329
|
distance_threshold?: number | undefined;
|
|
4298
4330
|
}, {
|
|
4299
4331
|
type: "topic_map";
|
|
@@ -4312,6 +4344,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4312
4344
|
hierarchy_threshold?: number | undefined;
|
|
4313
4345
|
naming_model?: string | undefined;
|
|
4314
4346
|
} | undefined;
|
|
4347
|
+
disable_reconciliation?: boolean | undefined;
|
|
4315
4348
|
distance_threshold?: number | undefined;
|
|
4316
4349
|
}>, z.ZodUnknown>]>;
|
|
4317
4350
|
declare const PromptData: z.ZodObject<{
|
|
@@ -10684,6 +10717,31 @@ type InferParameters<T extends EvalParameters> = {
|
|
|
10684
10717
|
};
|
|
10685
10718
|
|
|
10686
10719
|
declare const RESET_CONTEXT_MANAGER_STATE: unique symbol;
|
|
10720
|
+
declare const datasetRestorePreviewResultSchema: z.ZodObject<{
|
|
10721
|
+
rows_to_restore: z.ZodNumber;
|
|
10722
|
+
rows_to_delete: z.ZodNumber;
|
|
10723
|
+
}, "strip", z.ZodTypeAny, {
|
|
10724
|
+
rows_to_restore: number;
|
|
10725
|
+
rows_to_delete: number;
|
|
10726
|
+
}, {
|
|
10727
|
+
rows_to_restore: number;
|
|
10728
|
+
rows_to_delete: number;
|
|
10729
|
+
}>;
|
|
10730
|
+
type DatasetRestorePreviewResult = z.infer<typeof datasetRestorePreviewResultSchema>;
|
|
10731
|
+
declare const datasetRestoreResultSchema: z.ZodObject<{
|
|
10732
|
+
xact_id: z.ZodNullable<z.ZodString>;
|
|
10733
|
+
rows_restored: z.ZodNumber;
|
|
10734
|
+
rows_deleted: z.ZodNumber;
|
|
10735
|
+
}, "strip", z.ZodTypeAny, {
|
|
10736
|
+
xact_id: string | null;
|
|
10737
|
+
rows_restored: number;
|
|
10738
|
+
rows_deleted: number;
|
|
10739
|
+
}, {
|
|
10740
|
+
xact_id: string | null;
|
|
10741
|
+
rows_restored: number;
|
|
10742
|
+
rows_deleted: number;
|
|
10743
|
+
}>;
|
|
10744
|
+
type DatasetRestoreResult = z.infer<typeof datasetRestoreResultSchema>;
|
|
10687
10745
|
declare const parametersRowSchema: z.ZodObject<{
|
|
10688
10746
|
id: z.ZodString;
|
|
10689
10747
|
_xact_id: z.ZodString;
|
|
@@ -11257,6 +11315,20 @@ declare class HTTPBackgroundLogger implements BackgroundLogger {
|
|
|
11257
11315
|
disable(): void;
|
|
11258
11316
|
enforceQueueSizeLimit(enforce: boolean): void;
|
|
11259
11317
|
}
|
|
11318
|
+
type DatasetSnapshotNameLookup = {
|
|
11319
|
+
snapshotName: string;
|
|
11320
|
+
xactId?: never;
|
|
11321
|
+
};
|
|
11322
|
+
type DatasetSnapshotXactLookup = {
|
|
11323
|
+
snapshotName?: never;
|
|
11324
|
+
xactId: string;
|
|
11325
|
+
};
|
|
11326
|
+
type DatasetSnapshotLookup = DatasetSnapshotNameLookup | DatasetSnapshotXactLookup;
|
|
11327
|
+
type DatasetPinState = {
|
|
11328
|
+
lazyPinnedVersion?: LazyValue<string | undefined>;
|
|
11329
|
+
pinnedEnvironment?: string;
|
|
11330
|
+
pinnedSnapshotName?: string;
|
|
11331
|
+
};
|
|
11260
11332
|
type AsyncFlushArg<IsAsyncFlush> = {
|
|
11261
11333
|
asyncFlush?: IsAsyncFlush;
|
|
11262
11334
|
};
|
|
@@ -11344,6 +11416,9 @@ declare class ObjectFetcher<RecordType> implements AsyncIterable<WithTransaction
|
|
|
11344
11416
|
constructor(objectType: "dataset" | "experiment" | "project_logs" | "playground_logs", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => WithTransactionId<RecordType>) | undefined, _internal_btql?: Record<string, unknown> | undefined);
|
|
11345
11417
|
get id(): Promise<string>;
|
|
11346
11418
|
protected getState(): Promise<BraintrustState>;
|
|
11419
|
+
protected getPinnedVersion(): string | undefined;
|
|
11420
|
+
protected setPinnedVersion(pinnedVersion: string | undefined): void;
|
|
11421
|
+
protected getInternalBtql(): Record<string, unknown> | undefined;
|
|
11347
11422
|
private fetchRecordsFromApi;
|
|
11348
11423
|
/**
|
|
11349
11424
|
* Fetch all records from the object.
|
|
@@ -11509,12 +11584,25 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
|
|
|
11509
11584
|
private readonly lazyMetadata;
|
|
11510
11585
|
private readonly __braintrust_dataset_marker;
|
|
11511
11586
|
private newRecords;
|
|
11512
|
-
|
|
11587
|
+
private lazyPinnedVersion?;
|
|
11588
|
+
private pinnedEnvironment?;
|
|
11589
|
+
private pinnedSnapshotName?;
|
|
11590
|
+
constructor(state: BraintrustState, lazyMetadata: LazyValue<ProjectDatasetMetadata>, pinnedVersion?: string, legacy?: IsLegacyDataset, _internal_btql?: Record<string, unknown>, pinState?: DatasetPinState);
|
|
11513
11591
|
get id(): Promise<string>;
|
|
11514
11592
|
get name(): Promise<string>;
|
|
11515
11593
|
get project(): Promise<ObjectMetadata>;
|
|
11516
11594
|
get loggingState(): BraintrustState;
|
|
11595
|
+
toEvalData(): Promise<{
|
|
11596
|
+
dataset_id: string;
|
|
11597
|
+
dataset_version?: string;
|
|
11598
|
+
dataset_environment?: string;
|
|
11599
|
+
dataset_snapshot_name?: string;
|
|
11600
|
+
_internal_btql?: Record<string, unknown>;
|
|
11601
|
+
}>;
|
|
11517
11602
|
protected getState(): Promise<BraintrustState>;
|
|
11603
|
+
version(options?: {
|
|
11604
|
+
batchSize?: number;
|
|
11605
|
+
}): Promise<string | undefined>;
|
|
11518
11606
|
private validateEvent;
|
|
11519
11607
|
private createArgs;
|
|
11520
11608
|
/**
|
|
@@ -11562,6 +11650,24 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
|
|
|
11562
11650
|
readonly metadata?: Record<string, unknown>;
|
|
11563
11651
|
}): string;
|
|
11564
11652
|
delete(id: string): string;
|
|
11653
|
+
createSnapshot({ name, description, update, }: {
|
|
11654
|
+
readonly name: string;
|
|
11655
|
+
readonly description?: string;
|
|
11656
|
+
readonly update?: boolean;
|
|
11657
|
+
}): Promise<DatasetSnapshotType>;
|
|
11658
|
+
listSnapshots(): Promise<DatasetSnapshotType[]>;
|
|
11659
|
+
getSnapshot(lookup: DatasetSnapshotLookup): Promise<DatasetSnapshotType | undefined>;
|
|
11660
|
+
updateSnapshot(snapshotId: string, { name, description, }: {
|
|
11661
|
+
readonly name?: string;
|
|
11662
|
+
readonly description?: string | null;
|
|
11663
|
+
}): Promise<DatasetSnapshotType>;
|
|
11664
|
+
deleteSnapshot(snapshotId: string): Promise<DatasetSnapshotType>;
|
|
11665
|
+
restorePreview({ version, }: {
|
|
11666
|
+
readonly version: string;
|
|
11667
|
+
}): Promise<DatasetRestorePreviewResult>;
|
|
11668
|
+
restore({ version, }: {
|
|
11669
|
+
readonly version: string;
|
|
11670
|
+
}): Promise<DatasetRestoreResult>;
|
|
11565
11671
|
/**
|
|
11566
11672
|
* Summarize the dataset, including high level metrics about its size and other metadata.
|
|
11567
11673
|
* @param summarizeData Whether to summarize the data. If false, only the metadata will be returned.
|
package/dev/dist/index.d.ts
CHANGED
|
@@ -1474,6 +1474,29 @@ declare const SavedFunctionId: z.ZodUnion<[z.ZodObject<{
|
|
|
1474
1474
|
function_type?: "llm" | "scorer" | "task" | "tool" | "custom_view" | "preprocessor" | "facet" | "classifier" | "tag" | "parameters" | "sandbox" | undefined;
|
|
1475
1475
|
}>]>;
|
|
1476
1476
|
type SavedFunctionIdType = z.infer<typeof SavedFunctionId>;
|
|
1477
|
+
declare const DatasetSnapshot: z.ZodObject<{
|
|
1478
|
+
id: z.ZodString;
|
|
1479
|
+
dataset_id: z.ZodString;
|
|
1480
|
+
name: z.ZodString;
|
|
1481
|
+
description: z.ZodUnion<[z.ZodString, z.ZodNull]>;
|
|
1482
|
+
xact_id: z.ZodString;
|
|
1483
|
+
created: z.ZodUnion<[z.ZodString, z.ZodNull]>;
|
|
1484
|
+
}, "strip", z.ZodTypeAny, {
|
|
1485
|
+
id: string;
|
|
1486
|
+
created: string | null;
|
|
1487
|
+
name: string;
|
|
1488
|
+
description: string | null;
|
|
1489
|
+
dataset_id: string;
|
|
1490
|
+
xact_id: string;
|
|
1491
|
+
}, {
|
|
1492
|
+
id: string;
|
|
1493
|
+
created: string | null;
|
|
1494
|
+
name: string;
|
|
1495
|
+
description: string | null;
|
|
1496
|
+
dataset_id: string;
|
|
1497
|
+
xact_id: string;
|
|
1498
|
+
}>;
|
|
1499
|
+
type DatasetSnapshotType = z.infer<typeof DatasetSnapshot>;
|
|
1477
1500
|
declare const RepoInfo: z.ZodUnion<[z.ZodObject<{
|
|
1478
1501
|
commit: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
1479
1502
|
branch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
|
|
@@ -4035,6 +4058,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4035
4058
|
hierarchy_threshold?: number | undefined;
|
|
4036
4059
|
naming_model?: string | undefined;
|
|
4037
4060
|
}>>;
|
|
4061
|
+
disable_reconciliation: z.ZodOptional<z.ZodBoolean>;
|
|
4038
4062
|
distance_threshold: z.ZodOptional<z.ZodNumber>;
|
|
4039
4063
|
}, "strip", z.ZodTypeAny, {
|
|
4040
4064
|
type: "topic_map";
|
|
@@ -4053,6 +4077,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4053
4077
|
hierarchy_threshold?: number | undefined;
|
|
4054
4078
|
naming_model?: string | undefined;
|
|
4055
4079
|
} | undefined;
|
|
4080
|
+
disable_reconciliation?: boolean | undefined;
|
|
4056
4081
|
distance_threshold?: number | undefined;
|
|
4057
4082
|
}, {
|
|
4058
4083
|
type: "topic_map";
|
|
@@ -4071,6 +4096,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4071
4096
|
hierarchy_threshold?: number | undefined;
|
|
4072
4097
|
naming_model?: string | undefined;
|
|
4073
4098
|
} | undefined;
|
|
4099
|
+
disable_reconciliation?: boolean | undefined;
|
|
4074
4100
|
distance_threshold?: number | undefined;
|
|
4075
4101
|
}>;
|
|
4076
4102
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4092,6 +4118,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4092
4118
|
hierarchy_threshold?: number | undefined;
|
|
4093
4119
|
naming_model?: string | undefined;
|
|
4094
4120
|
} | undefined;
|
|
4121
|
+
disable_reconciliation?: boolean | undefined;
|
|
4095
4122
|
distance_threshold?: number | undefined;
|
|
4096
4123
|
};
|
|
4097
4124
|
topic_map_id?: string | undefined;
|
|
@@ -4114,6 +4141,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4114
4141
|
hierarchy_threshold?: number | undefined;
|
|
4115
4142
|
naming_model?: string | undefined;
|
|
4116
4143
|
} | undefined;
|
|
4144
|
+
disable_reconciliation?: boolean | undefined;
|
|
4117
4145
|
distance_threshold?: number | undefined;
|
|
4118
4146
|
};
|
|
4119
4147
|
topic_map_id?: string | undefined;
|
|
@@ -4155,6 +4183,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4155
4183
|
hierarchy_threshold?: number | undefined;
|
|
4156
4184
|
naming_model?: string | undefined;
|
|
4157
4185
|
} | undefined;
|
|
4186
|
+
disable_reconciliation?: boolean | undefined;
|
|
4158
4187
|
distance_threshold?: number | undefined;
|
|
4159
4188
|
};
|
|
4160
4189
|
topic_map_id?: string | undefined;
|
|
@@ -4196,6 +4225,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4196
4225
|
hierarchy_threshold?: number | undefined;
|
|
4197
4226
|
naming_model?: string | undefined;
|
|
4198
4227
|
} | undefined;
|
|
4228
|
+
disable_reconciliation?: boolean | undefined;
|
|
4199
4229
|
distance_threshold?: number | undefined;
|
|
4200
4230
|
};
|
|
4201
4231
|
topic_map_id?: string | undefined;
|
|
@@ -4276,6 +4306,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4276
4306
|
hierarchy_threshold?: number | undefined;
|
|
4277
4307
|
naming_model?: string | undefined;
|
|
4278
4308
|
}>>;
|
|
4309
|
+
disable_reconciliation: z.ZodOptional<z.ZodBoolean>;
|
|
4279
4310
|
distance_threshold: z.ZodOptional<z.ZodNumber>;
|
|
4280
4311
|
}, "strip", z.ZodTypeAny, {
|
|
4281
4312
|
type: "topic_map";
|
|
@@ -4294,6 +4325,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4294
4325
|
hierarchy_threshold?: number | undefined;
|
|
4295
4326
|
naming_model?: string | undefined;
|
|
4296
4327
|
} | undefined;
|
|
4328
|
+
disable_reconciliation?: boolean | undefined;
|
|
4297
4329
|
distance_threshold?: number | undefined;
|
|
4298
4330
|
}, {
|
|
4299
4331
|
type: "topic_map";
|
|
@@ -4312,6 +4344,7 @@ declare const FunctionData: z.ZodUnion<[z.ZodObject<{
|
|
|
4312
4344
|
hierarchy_threshold?: number | undefined;
|
|
4313
4345
|
naming_model?: string | undefined;
|
|
4314
4346
|
} | undefined;
|
|
4347
|
+
disable_reconciliation?: boolean | undefined;
|
|
4315
4348
|
distance_threshold?: number | undefined;
|
|
4316
4349
|
}>, z.ZodUnknown>]>;
|
|
4317
4350
|
declare const PromptData: z.ZodObject<{
|
|
@@ -10684,6 +10717,31 @@ type InferParameters<T extends EvalParameters> = {
|
|
|
10684
10717
|
};
|
|
10685
10718
|
|
|
10686
10719
|
declare const RESET_CONTEXT_MANAGER_STATE: unique symbol;
|
|
10720
|
+
declare const datasetRestorePreviewResultSchema: z.ZodObject<{
|
|
10721
|
+
rows_to_restore: z.ZodNumber;
|
|
10722
|
+
rows_to_delete: z.ZodNumber;
|
|
10723
|
+
}, "strip", z.ZodTypeAny, {
|
|
10724
|
+
rows_to_restore: number;
|
|
10725
|
+
rows_to_delete: number;
|
|
10726
|
+
}, {
|
|
10727
|
+
rows_to_restore: number;
|
|
10728
|
+
rows_to_delete: number;
|
|
10729
|
+
}>;
|
|
10730
|
+
type DatasetRestorePreviewResult = z.infer<typeof datasetRestorePreviewResultSchema>;
|
|
10731
|
+
declare const datasetRestoreResultSchema: z.ZodObject<{
|
|
10732
|
+
xact_id: z.ZodNullable<z.ZodString>;
|
|
10733
|
+
rows_restored: z.ZodNumber;
|
|
10734
|
+
rows_deleted: z.ZodNumber;
|
|
10735
|
+
}, "strip", z.ZodTypeAny, {
|
|
10736
|
+
xact_id: string | null;
|
|
10737
|
+
rows_restored: number;
|
|
10738
|
+
rows_deleted: number;
|
|
10739
|
+
}, {
|
|
10740
|
+
xact_id: string | null;
|
|
10741
|
+
rows_restored: number;
|
|
10742
|
+
rows_deleted: number;
|
|
10743
|
+
}>;
|
|
10744
|
+
type DatasetRestoreResult = z.infer<typeof datasetRestoreResultSchema>;
|
|
10687
10745
|
declare const parametersRowSchema: z.ZodObject<{
|
|
10688
10746
|
id: z.ZodString;
|
|
10689
10747
|
_xact_id: z.ZodString;
|
|
@@ -11257,6 +11315,20 @@ declare class HTTPBackgroundLogger implements BackgroundLogger {
|
|
|
11257
11315
|
disable(): void;
|
|
11258
11316
|
enforceQueueSizeLimit(enforce: boolean): void;
|
|
11259
11317
|
}
|
|
11318
|
+
type DatasetSnapshotNameLookup = {
|
|
11319
|
+
snapshotName: string;
|
|
11320
|
+
xactId?: never;
|
|
11321
|
+
};
|
|
11322
|
+
type DatasetSnapshotXactLookup = {
|
|
11323
|
+
snapshotName?: never;
|
|
11324
|
+
xactId: string;
|
|
11325
|
+
};
|
|
11326
|
+
type DatasetSnapshotLookup = DatasetSnapshotNameLookup | DatasetSnapshotXactLookup;
|
|
11327
|
+
type DatasetPinState = {
|
|
11328
|
+
lazyPinnedVersion?: LazyValue<string | undefined>;
|
|
11329
|
+
pinnedEnvironment?: string;
|
|
11330
|
+
pinnedSnapshotName?: string;
|
|
11331
|
+
};
|
|
11260
11332
|
type AsyncFlushArg<IsAsyncFlush> = {
|
|
11261
11333
|
asyncFlush?: IsAsyncFlush;
|
|
11262
11334
|
};
|
|
@@ -11344,6 +11416,9 @@ declare class ObjectFetcher<RecordType> implements AsyncIterable<WithTransaction
|
|
|
11344
11416
|
constructor(objectType: "dataset" | "experiment" | "project_logs" | "playground_logs", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => WithTransactionId<RecordType>) | undefined, _internal_btql?: Record<string, unknown> | undefined);
|
|
11345
11417
|
get id(): Promise<string>;
|
|
11346
11418
|
protected getState(): Promise<BraintrustState>;
|
|
11419
|
+
protected getPinnedVersion(): string | undefined;
|
|
11420
|
+
protected setPinnedVersion(pinnedVersion: string | undefined): void;
|
|
11421
|
+
protected getInternalBtql(): Record<string, unknown> | undefined;
|
|
11347
11422
|
private fetchRecordsFromApi;
|
|
11348
11423
|
/**
|
|
11349
11424
|
* Fetch all records from the object.
|
|
@@ -11509,12 +11584,25 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
|
|
|
11509
11584
|
private readonly lazyMetadata;
|
|
11510
11585
|
private readonly __braintrust_dataset_marker;
|
|
11511
11586
|
private newRecords;
|
|
11512
|
-
|
|
11587
|
+
private lazyPinnedVersion?;
|
|
11588
|
+
private pinnedEnvironment?;
|
|
11589
|
+
private pinnedSnapshotName?;
|
|
11590
|
+
constructor(state: BraintrustState, lazyMetadata: LazyValue<ProjectDatasetMetadata>, pinnedVersion?: string, legacy?: IsLegacyDataset, _internal_btql?: Record<string, unknown>, pinState?: DatasetPinState);
|
|
11513
11591
|
get id(): Promise<string>;
|
|
11514
11592
|
get name(): Promise<string>;
|
|
11515
11593
|
get project(): Promise<ObjectMetadata>;
|
|
11516
11594
|
get loggingState(): BraintrustState;
|
|
11595
|
+
toEvalData(): Promise<{
|
|
11596
|
+
dataset_id: string;
|
|
11597
|
+
dataset_version?: string;
|
|
11598
|
+
dataset_environment?: string;
|
|
11599
|
+
dataset_snapshot_name?: string;
|
|
11600
|
+
_internal_btql?: Record<string, unknown>;
|
|
11601
|
+
}>;
|
|
11517
11602
|
protected getState(): Promise<BraintrustState>;
|
|
11603
|
+
version(options?: {
|
|
11604
|
+
batchSize?: number;
|
|
11605
|
+
}): Promise<string | undefined>;
|
|
11518
11606
|
private validateEvent;
|
|
11519
11607
|
private createArgs;
|
|
11520
11608
|
/**
|
|
@@ -11562,6 +11650,24 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
|
|
|
11562
11650
|
readonly metadata?: Record<string, unknown>;
|
|
11563
11651
|
}): string;
|
|
11564
11652
|
delete(id: string): string;
|
|
11653
|
+
createSnapshot({ name, description, update, }: {
|
|
11654
|
+
readonly name: string;
|
|
11655
|
+
readonly description?: string;
|
|
11656
|
+
readonly update?: boolean;
|
|
11657
|
+
}): Promise<DatasetSnapshotType>;
|
|
11658
|
+
listSnapshots(): Promise<DatasetSnapshotType[]>;
|
|
11659
|
+
getSnapshot(lookup: DatasetSnapshotLookup): Promise<DatasetSnapshotType | undefined>;
|
|
11660
|
+
updateSnapshot(snapshotId: string, { name, description, }: {
|
|
11661
|
+
readonly name?: string;
|
|
11662
|
+
readonly description?: string | null;
|
|
11663
|
+
}): Promise<DatasetSnapshotType>;
|
|
11664
|
+
deleteSnapshot(snapshotId: string): Promise<DatasetSnapshotType>;
|
|
11665
|
+
restorePreview({ version, }: {
|
|
11666
|
+
readonly version: string;
|
|
11667
|
+
}): Promise<DatasetRestorePreviewResult>;
|
|
11668
|
+
restore({ version, }: {
|
|
11669
|
+
readonly version: string;
|
|
11670
|
+
}): Promise<DatasetRestoreResult>;
|
|
11565
11671
|
/**
|
|
11566
11672
|
* Summarize the dataset, including high level metrics about its size and other metadata.
|
|
11567
11673
|
* @param summarizeData Whether to summarize the data. If false, only the metadata will be returned.
|