braintrust 0.0.183 → 0.0.185
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.mts +62 -18
- package/dist/browser.d.ts +62 -18
- package/dist/browser.js +284 -142
- package/dist/browser.mjs +301 -158
- package/dist/cli.js +373 -180
- package/dist/index.d.mts +74 -18
- package/dist/index.d.ts +74 -18
- package/dist/index.js +323 -159
- package/dist/index.mjs +339 -175
- package/package.json +2 -2
package/dist/browser.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogFeedbackFullArgs, ExperimentEvent, BackgroundLogEvent, ExperimentLogFullArgs, ExperimentLogPartialArgs, IdField, SpanType, SpanComponentsV3, DEFAULT_IS_LEGACY_DATASET, TRANSACTION_ID_FIELD, TransactionId, SpanObjectTypeV3, DatasetRecord } from '@braintrust/core';
|
|
2
|
-
import { GitMetadataSettings, AttachmentReference, AttachmentStatus, RepoInfo, PromptData, OpenAIMessage, Tools, AnyModelParam, Message, Prompt as Prompt$1, PromptSessionEvent, CallEventSchema, StreamingMode } from '@braintrust/core/typespecs';
|
|
2
|
+
import { GitMetadataSettings, AttachmentReference, AttachmentStatus, RepoInfo, PromptData, OpenAIMessage, Tools, AnyModelParam, Message, Prompt as Prompt$1, ModelParams, PromptSessionEvent, CallEventSchema, StreamingMode } from '@braintrust/core/typespecs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
interface IsoAsyncLocalStorage<T> {
|
|
@@ -8,14 +8,6 @@ interface IsoAsyncLocalStorage<T> {
|
|
|
8
8
|
getStore(): T | undefined;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
declare class LazyValue<T> {
|
|
12
|
-
private callable;
|
|
13
|
-
private value;
|
|
14
|
-
constructor(callable: () => Promise<T>);
|
|
15
|
-
get(): Promise<T>;
|
|
16
|
-
get hasComputed(): boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
11
|
/**
|
|
20
12
|
* Options for configuring an LRUCache instance.
|
|
21
13
|
*/
|
|
@@ -183,6 +175,14 @@ declare class PromptCache {
|
|
|
183
175
|
set(key: PromptKey, value: Prompt): Promise<void>;
|
|
184
176
|
}
|
|
185
177
|
|
|
178
|
+
declare class LazyValue<T> {
|
|
179
|
+
private callable;
|
|
180
|
+
private value;
|
|
181
|
+
constructor(callable: () => Promise<T>);
|
|
182
|
+
get(): Promise<T>;
|
|
183
|
+
get hasSucceeded(): boolean;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
186
|
type SetCurrentArg = {
|
|
187
187
|
setCurrent?: boolean;
|
|
188
188
|
};
|
|
@@ -215,6 +215,18 @@ interface Span extends Exportable {
|
|
|
215
215
|
* Row ID of the span.
|
|
216
216
|
*/
|
|
217
217
|
id: string;
|
|
218
|
+
/**
|
|
219
|
+
* Span ID of the span.
|
|
220
|
+
*/
|
|
221
|
+
spanId: string;
|
|
222
|
+
/**
|
|
223
|
+
* Root span ID of the span.
|
|
224
|
+
*/
|
|
225
|
+
rootSpanId: string;
|
|
226
|
+
/**
|
|
227
|
+
* Parent span IDs of the span.
|
|
228
|
+
*/
|
|
229
|
+
spanParents: string[];
|
|
218
230
|
/**
|
|
219
231
|
* Incrementally update the current span with new data. The event will be batched and uploaded behind the scenes.
|
|
220
232
|
*
|
|
@@ -303,6 +315,9 @@ interface Span extends Exportable {
|
|
|
303
315
|
*/
|
|
304
316
|
declare class NoopSpan implements Span {
|
|
305
317
|
id: string;
|
|
318
|
+
spanId: string;
|
|
319
|
+
rootSpanId: string;
|
|
320
|
+
spanParents: string[];
|
|
306
321
|
kind: "span";
|
|
307
322
|
constructor();
|
|
308
323
|
log(_: ExperimentLogPartialArgs): void;
|
|
@@ -811,6 +826,7 @@ type InitDatasetOptions<IsLegacyDataset extends boolean> = FullLoginOptions & {
|
|
|
811
826
|
projectId?: string;
|
|
812
827
|
metadata?: Record<string, unknown>;
|
|
813
828
|
state?: BraintrustState;
|
|
829
|
+
_internal_btql?: Record<string, unknown>;
|
|
814
830
|
} & UseOutputOption<IsLegacyDataset>;
|
|
815
831
|
type FullInitDatasetOptions<IsLegacyDataset extends boolean> = {
|
|
816
832
|
project?: string;
|
|
@@ -1078,8 +1094,9 @@ declare class ObjectFetcher<RecordType> implements AsyncIterable<WithTransaction
|
|
|
1078
1094
|
private objectType;
|
|
1079
1095
|
private pinnedVersion;
|
|
1080
1096
|
private mutateRecord?;
|
|
1097
|
+
private _internal_btql?;
|
|
1081
1098
|
private _fetchedData;
|
|
1082
|
-
constructor(objectType: "dataset" | "experiment", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => RecordType) | undefined);
|
|
1099
|
+
constructor(objectType: "dataset" | "experiment", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => RecordType) | undefined, _internal_btql?: Record<string, unknown> | undefined);
|
|
1083
1100
|
get id(): Promise<string>;
|
|
1084
1101
|
protected getState(): Promise<BraintrustState>;
|
|
1085
1102
|
fetch(): AsyncGenerator<WithTransactionId<RecordType>>;
|
|
@@ -1095,6 +1112,7 @@ type EvalCase<Input, Expected, Metadata> = {
|
|
|
1095
1112
|
tags?: string[];
|
|
1096
1113
|
id?: string;
|
|
1097
1114
|
_xact_id?: TransactionId;
|
|
1115
|
+
created?: string | null;
|
|
1098
1116
|
upsert_id?: string;
|
|
1099
1117
|
} & (Expected extends void ? object : {
|
|
1100
1118
|
expected: Expected;
|
|
@@ -1239,9 +1257,9 @@ declare class SpanImpl implements Span {
|
|
|
1239
1257
|
private parentObjectId;
|
|
1240
1258
|
private parentComputeObjectMetadataArgs;
|
|
1241
1259
|
private _id;
|
|
1242
|
-
private
|
|
1243
|
-
private
|
|
1244
|
-
private
|
|
1260
|
+
private _spanId;
|
|
1261
|
+
private _rootSpanId;
|
|
1262
|
+
private _spanParents;
|
|
1245
1263
|
kind: "span";
|
|
1246
1264
|
constructor(args: {
|
|
1247
1265
|
state: BraintrustState;
|
|
@@ -1252,6 +1270,9 @@ declare class SpanImpl implements Span {
|
|
|
1252
1270
|
defaultRootType?: SpanType;
|
|
1253
1271
|
} & Omit<StartSpanArgs, "parent">);
|
|
1254
1272
|
get id(): string;
|
|
1273
|
+
get spanId(): string;
|
|
1274
|
+
get rootSpanId(): string;
|
|
1275
|
+
get spanParents(): string[];
|
|
1255
1276
|
setAttributes(args: Omit<StartSpanArgs, "event">): void;
|
|
1256
1277
|
log(event: ExperimentLogPartialArgs): void;
|
|
1257
1278
|
private logInternal;
|
|
@@ -1275,7 +1296,8 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
|
|
|
1275
1296
|
private state;
|
|
1276
1297
|
private readonly lazyMetadata;
|
|
1277
1298
|
private readonly __braintrust_dataset_marker;
|
|
1278
|
-
|
|
1299
|
+
private newRecords;
|
|
1300
|
+
constructor(state: BraintrustState, lazyMetadata: LazyValue<ProjectDatasetMetadata>, pinnedVersion?: string, legacy?: IsLegacyDataset, _internal_btql?: Record<string, unknown>);
|
|
1279
1301
|
get id(): Promise<string>;
|
|
1280
1302
|
get name(): Promise<string>;
|
|
1281
1303
|
get project(): Promise<ObjectMetadata>;
|
|
@@ -1373,6 +1395,14 @@ type CompiledPrompt<Flavor extends "chat" | "completion"> = CompiledPromptParams
|
|
|
1373
1395
|
type DefaultPromptArgs = Partial<CompiledPromptParams & AnyModelParam & ChatPrompt & CompletionPrompt>;
|
|
1374
1396
|
declare function renderMessage<T extends Message>(render: (template: string) => string, message: T): T;
|
|
1375
1397
|
type PromptRowWithId<HasId extends boolean = true, HasVersion extends boolean = true> = Omit<Prompt$1, "log_id" | "org_id" | "project_id" | "id" | "_xact_id"> & Partial<Pick<Prompt$1, "project_id">> & (HasId extends true ? Pick<Prompt$1, "id"> : Partial<Pick<Prompt$1, "id">>) & (HasVersion extends true ? Pick<Prompt$1, "_xact_id"> : Partial<Pick<Prompt$1, "_xact_id">>);
|
|
1398
|
+
declare function deserializePlainStringAsJSON(s: string): {
|
|
1399
|
+
value: any;
|
|
1400
|
+
error: undefined;
|
|
1401
|
+
} | {
|
|
1402
|
+
value: string;
|
|
1403
|
+
error: unknown;
|
|
1404
|
+
};
|
|
1405
|
+
declare function renderPromptParams(params: ModelParams | undefined, args: unknown): ModelParams | undefined;
|
|
1376
1406
|
declare class Prompt<HasId extends boolean = true, HasVersion extends boolean = true> {
|
|
1377
1407
|
private metadata;
|
|
1378
1408
|
private defaults;
|
|
@@ -1458,11 +1488,16 @@ interface ExperimentSummary {
|
|
|
1458
1488
|
/**
|
|
1459
1489
|
* Summary of a dataset's data.
|
|
1460
1490
|
*
|
|
1461
|
-
* @property newRecords New or updated records added in this session.
|
|
1462
1491
|
* @property totalRecords Total records in the dataset.
|
|
1463
1492
|
*/
|
|
1464
1493
|
interface DataSummary {
|
|
1494
|
+
/**
|
|
1495
|
+
* New or updated records added in this session.
|
|
1496
|
+
*/
|
|
1465
1497
|
newRecords: number;
|
|
1498
|
+
/**
|
|
1499
|
+
* Total records in the dataset.
|
|
1500
|
+
*/
|
|
1466
1501
|
totalRecords: number;
|
|
1467
1502
|
}
|
|
1468
1503
|
/**
|
|
@@ -1479,7 +1514,7 @@ interface DatasetSummary {
|
|
|
1479
1514
|
datasetName: string;
|
|
1480
1515
|
projectUrl: string;
|
|
1481
1516
|
datasetUrl: string;
|
|
1482
|
-
dataSummary: DataSummary;
|
|
1517
|
+
dataSummary: DataSummary | undefined;
|
|
1483
1518
|
}
|
|
1484
1519
|
/**
|
|
1485
1520
|
* Allows accessing helper functions for testing.
|
|
@@ -1551,16 +1586,19 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1551
1586
|
object_id: z.ZodString;
|
|
1552
1587
|
id: z.ZodString;
|
|
1553
1588
|
_xact_id: z.ZodString;
|
|
1589
|
+
created: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1554
1590
|
}, "strip", z.ZodTypeAny, {
|
|
1555
1591
|
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
1556
1592
|
object_id: string;
|
|
1557
1593
|
id: string;
|
|
1558
1594
|
_xact_id: string;
|
|
1595
|
+
created?: string | null | undefined;
|
|
1559
1596
|
}, {
|
|
1560
1597
|
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
1561
1598
|
object_id: string;
|
|
1562
1599
|
id: string;
|
|
1563
1600
|
_xact_id: string;
|
|
1601
|
+
created?: string | null | undefined;
|
|
1564
1602
|
}>>>;
|
|
1565
1603
|
format: z.ZodEnum<["llm", "code", "global"]>;
|
|
1566
1604
|
output_type: z.ZodEnum<["completion", "score", "any"]>;
|
|
@@ -1580,6 +1618,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1580
1618
|
object_id: string;
|
|
1581
1619
|
id: string;
|
|
1582
1620
|
_xact_id: string;
|
|
1621
|
+
created?: string | null | undefined;
|
|
1583
1622
|
} | null | undefined;
|
|
1584
1623
|
}, {
|
|
1585
1624
|
format: "code" | "global" | "llm";
|
|
@@ -1594,6 +1633,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1594
1633
|
object_id: string;
|
|
1595
1634
|
id: string;
|
|
1596
1635
|
_xact_id: string;
|
|
1636
|
+
created?: string | null | undefined;
|
|
1597
1637
|
} | null | undefined;
|
|
1598
1638
|
}>;
|
|
1599
1639
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1610,6 +1650,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1610
1650
|
object_id: string;
|
|
1611
1651
|
id: string;
|
|
1612
1652
|
_xact_id: string;
|
|
1653
|
+
created?: string | null | undefined;
|
|
1613
1654
|
} | null | undefined;
|
|
1614
1655
|
};
|
|
1615
1656
|
type: "progress";
|
|
@@ -1627,6 +1668,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1627
1668
|
object_id: string;
|
|
1628
1669
|
id: string;
|
|
1629
1670
|
_xact_id: string;
|
|
1671
|
+
created?: string | null | undefined;
|
|
1630
1672
|
} | null | undefined;
|
|
1631
1673
|
};
|
|
1632
1674
|
type: "progress";
|
|
@@ -1937,6 +1979,7 @@ declare const braintrust_createFinalValuePassThroughStream: typeof createFinalVa
|
|
|
1937
1979
|
declare const braintrust_currentExperiment: typeof currentExperiment;
|
|
1938
1980
|
declare const braintrust_currentLogger: typeof currentLogger;
|
|
1939
1981
|
declare const braintrust_currentSpan: typeof currentSpan;
|
|
1982
|
+
declare const braintrust_deserializePlainStringAsJSON: typeof deserializePlainStringAsJSON;
|
|
1940
1983
|
declare const braintrust_devNullWritableStream: typeof devNullWritableStream;
|
|
1941
1984
|
declare const braintrust_flush: typeof flush;
|
|
1942
1985
|
declare const braintrust_getSpanParentObject: typeof getSpanParentObject;
|
|
@@ -1955,6 +1998,7 @@ declare const braintrust_newId: typeof newId;
|
|
|
1955
1998
|
declare const braintrust_parseCachedHeader: typeof parseCachedHeader;
|
|
1956
1999
|
declare const braintrust_permalink: typeof permalink;
|
|
1957
2000
|
declare const braintrust_renderMessage: typeof renderMessage;
|
|
2001
|
+
declare const braintrust_renderPromptParams: typeof renderPromptParams;
|
|
1958
2002
|
declare const braintrust_setFetch: typeof setFetch;
|
|
1959
2003
|
declare const braintrust_spanComponentsToObjectId: typeof spanComponentsToObjectId;
|
|
1960
2004
|
declare const braintrust_startSpan: typeof startSpan;
|
|
@@ -1971,7 +2015,7 @@ declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
|
|
|
1971
2015
|
declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
|
|
1972
2016
|
declare const braintrust_wrapTraced: typeof wrapTraced;
|
|
1973
2017
|
declare namespace braintrust {
|
|
1974
|
-
export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, 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_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, type braintrust_EndSpanArgs as EndSpanArgs, type braintrust_EvalCase as EvalCase, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, 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_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, 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, 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_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, 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_setFetch as setFetch, 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 };
|
|
2018
|
+
export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, 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_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, type braintrust_EndSpanArgs as EndSpanArgs, type braintrust_EvalCase as EvalCase, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, 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_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, 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, 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_flush as flush, 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_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 };
|
|
1975
2019
|
}
|
|
1976
2020
|
|
|
1977
|
-
export { type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, type BaseMetadata, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type DataSummary, Dataset, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, type EndSpanArgs, type EvalCase, Experiment, type ExperimentSummary, type Exportable, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type InitOptions, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NoopSpan, type ObjectMetadata, type PromiseUnless, Prompt, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type ScoreSummary, type SerializedBraintrustState, type SetCurrentArg, type Span, SpanImpl, type StartSpanArgs, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, devNullWritableStream, flush, getSpanParentObject, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, renderMessage, setFetch, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|
|
2021
|
+
export { type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, type BaseMetadata, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type DataSummary, Dataset, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, type EndSpanArgs, type EvalCase, Experiment, type ExperimentSummary, type Exportable, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type InitOptions, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NoopSpan, type ObjectMetadata, type PromiseUnless, Prompt, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type ScoreSummary, type SerializedBraintrustState, type SetCurrentArg, type Span, SpanImpl, type StartSpanArgs, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, deserializePlainStringAsJSON, devNullWritableStream, flush, getSpanParentObject, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, renderMessage, renderPromptParams, setFetch, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogFeedbackFullArgs, ExperimentEvent, BackgroundLogEvent, ExperimentLogFullArgs, ExperimentLogPartialArgs, IdField, SpanType, SpanComponentsV3, DEFAULT_IS_LEGACY_DATASET, TRANSACTION_ID_FIELD, TransactionId, SpanObjectTypeV3, DatasetRecord } from '@braintrust/core';
|
|
2
|
-
import { GitMetadataSettings, AttachmentReference, AttachmentStatus, RepoInfo, PromptData, OpenAIMessage, Tools, AnyModelParam, Message, Prompt as Prompt$1, PromptSessionEvent, CallEventSchema, StreamingMode } from '@braintrust/core/typespecs';
|
|
2
|
+
import { GitMetadataSettings, AttachmentReference, AttachmentStatus, RepoInfo, PromptData, OpenAIMessage, Tools, AnyModelParam, Message, Prompt as Prompt$1, ModelParams, PromptSessionEvent, CallEventSchema, StreamingMode } from '@braintrust/core/typespecs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
interface IsoAsyncLocalStorage<T> {
|
|
@@ -8,14 +8,6 @@ interface IsoAsyncLocalStorage<T> {
|
|
|
8
8
|
getStore(): T | undefined;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
declare class LazyValue<T> {
|
|
12
|
-
private callable;
|
|
13
|
-
private value;
|
|
14
|
-
constructor(callable: () => Promise<T>);
|
|
15
|
-
get(): Promise<T>;
|
|
16
|
-
get hasComputed(): boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
11
|
/**
|
|
20
12
|
* Options for configuring an LRUCache instance.
|
|
21
13
|
*/
|
|
@@ -183,6 +175,14 @@ declare class PromptCache {
|
|
|
183
175
|
set(key: PromptKey, value: Prompt): Promise<void>;
|
|
184
176
|
}
|
|
185
177
|
|
|
178
|
+
declare class LazyValue<T> {
|
|
179
|
+
private callable;
|
|
180
|
+
private value;
|
|
181
|
+
constructor(callable: () => Promise<T>);
|
|
182
|
+
get(): Promise<T>;
|
|
183
|
+
get hasSucceeded(): boolean;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
186
|
type SetCurrentArg = {
|
|
187
187
|
setCurrent?: boolean;
|
|
188
188
|
};
|
|
@@ -215,6 +215,18 @@ interface Span extends Exportable {
|
|
|
215
215
|
* Row ID of the span.
|
|
216
216
|
*/
|
|
217
217
|
id: string;
|
|
218
|
+
/**
|
|
219
|
+
* Span ID of the span.
|
|
220
|
+
*/
|
|
221
|
+
spanId: string;
|
|
222
|
+
/**
|
|
223
|
+
* Root span ID of the span.
|
|
224
|
+
*/
|
|
225
|
+
rootSpanId: string;
|
|
226
|
+
/**
|
|
227
|
+
* Parent span IDs of the span.
|
|
228
|
+
*/
|
|
229
|
+
spanParents: string[];
|
|
218
230
|
/**
|
|
219
231
|
* Incrementally update the current span with new data. The event will be batched and uploaded behind the scenes.
|
|
220
232
|
*
|
|
@@ -303,6 +315,9 @@ interface Span extends Exportable {
|
|
|
303
315
|
*/
|
|
304
316
|
declare class NoopSpan implements Span {
|
|
305
317
|
id: string;
|
|
318
|
+
spanId: string;
|
|
319
|
+
rootSpanId: string;
|
|
320
|
+
spanParents: string[];
|
|
306
321
|
kind: "span";
|
|
307
322
|
constructor();
|
|
308
323
|
log(_: ExperimentLogPartialArgs): void;
|
|
@@ -811,6 +826,7 @@ type InitDatasetOptions<IsLegacyDataset extends boolean> = FullLoginOptions & {
|
|
|
811
826
|
projectId?: string;
|
|
812
827
|
metadata?: Record<string, unknown>;
|
|
813
828
|
state?: BraintrustState;
|
|
829
|
+
_internal_btql?: Record<string, unknown>;
|
|
814
830
|
} & UseOutputOption<IsLegacyDataset>;
|
|
815
831
|
type FullInitDatasetOptions<IsLegacyDataset extends boolean> = {
|
|
816
832
|
project?: string;
|
|
@@ -1078,8 +1094,9 @@ declare class ObjectFetcher<RecordType> implements AsyncIterable<WithTransaction
|
|
|
1078
1094
|
private objectType;
|
|
1079
1095
|
private pinnedVersion;
|
|
1080
1096
|
private mutateRecord?;
|
|
1097
|
+
private _internal_btql?;
|
|
1081
1098
|
private _fetchedData;
|
|
1082
|
-
constructor(objectType: "dataset" | "experiment", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => RecordType) | undefined);
|
|
1099
|
+
constructor(objectType: "dataset" | "experiment", pinnedVersion: string | undefined, mutateRecord?: ((r: any) => RecordType) | undefined, _internal_btql?: Record<string, unknown> | undefined);
|
|
1083
1100
|
get id(): Promise<string>;
|
|
1084
1101
|
protected getState(): Promise<BraintrustState>;
|
|
1085
1102
|
fetch(): AsyncGenerator<WithTransactionId<RecordType>>;
|
|
@@ -1095,6 +1112,7 @@ type EvalCase<Input, Expected, Metadata> = {
|
|
|
1095
1112
|
tags?: string[];
|
|
1096
1113
|
id?: string;
|
|
1097
1114
|
_xact_id?: TransactionId;
|
|
1115
|
+
created?: string | null;
|
|
1098
1116
|
upsert_id?: string;
|
|
1099
1117
|
} & (Expected extends void ? object : {
|
|
1100
1118
|
expected: Expected;
|
|
@@ -1239,9 +1257,9 @@ declare class SpanImpl implements Span {
|
|
|
1239
1257
|
private parentObjectId;
|
|
1240
1258
|
private parentComputeObjectMetadataArgs;
|
|
1241
1259
|
private _id;
|
|
1242
|
-
private
|
|
1243
|
-
private
|
|
1244
|
-
private
|
|
1260
|
+
private _spanId;
|
|
1261
|
+
private _rootSpanId;
|
|
1262
|
+
private _spanParents;
|
|
1245
1263
|
kind: "span";
|
|
1246
1264
|
constructor(args: {
|
|
1247
1265
|
state: BraintrustState;
|
|
@@ -1252,6 +1270,9 @@ declare class SpanImpl implements Span {
|
|
|
1252
1270
|
defaultRootType?: SpanType;
|
|
1253
1271
|
} & Omit<StartSpanArgs, "parent">);
|
|
1254
1272
|
get id(): string;
|
|
1273
|
+
get spanId(): string;
|
|
1274
|
+
get rootSpanId(): string;
|
|
1275
|
+
get spanParents(): string[];
|
|
1255
1276
|
setAttributes(args: Omit<StartSpanArgs, "event">): void;
|
|
1256
1277
|
log(event: ExperimentLogPartialArgs): void;
|
|
1257
1278
|
private logInternal;
|
|
@@ -1275,7 +1296,8 @@ declare class Dataset<IsLegacyDataset extends boolean = typeof DEFAULT_IS_LEGACY
|
|
|
1275
1296
|
private state;
|
|
1276
1297
|
private readonly lazyMetadata;
|
|
1277
1298
|
private readonly __braintrust_dataset_marker;
|
|
1278
|
-
|
|
1299
|
+
private newRecords;
|
|
1300
|
+
constructor(state: BraintrustState, lazyMetadata: LazyValue<ProjectDatasetMetadata>, pinnedVersion?: string, legacy?: IsLegacyDataset, _internal_btql?: Record<string, unknown>);
|
|
1279
1301
|
get id(): Promise<string>;
|
|
1280
1302
|
get name(): Promise<string>;
|
|
1281
1303
|
get project(): Promise<ObjectMetadata>;
|
|
@@ -1373,6 +1395,14 @@ type CompiledPrompt<Flavor extends "chat" | "completion"> = CompiledPromptParams
|
|
|
1373
1395
|
type DefaultPromptArgs = Partial<CompiledPromptParams & AnyModelParam & ChatPrompt & CompletionPrompt>;
|
|
1374
1396
|
declare function renderMessage<T extends Message>(render: (template: string) => string, message: T): T;
|
|
1375
1397
|
type PromptRowWithId<HasId extends boolean = true, HasVersion extends boolean = true> = Omit<Prompt$1, "log_id" | "org_id" | "project_id" | "id" | "_xact_id"> & Partial<Pick<Prompt$1, "project_id">> & (HasId extends true ? Pick<Prompt$1, "id"> : Partial<Pick<Prompt$1, "id">>) & (HasVersion extends true ? Pick<Prompt$1, "_xact_id"> : Partial<Pick<Prompt$1, "_xact_id">>);
|
|
1398
|
+
declare function deserializePlainStringAsJSON(s: string): {
|
|
1399
|
+
value: any;
|
|
1400
|
+
error: undefined;
|
|
1401
|
+
} | {
|
|
1402
|
+
value: string;
|
|
1403
|
+
error: unknown;
|
|
1404
|
+
};
|
|
1405
|
+
declare function renderPromptParams(params: ModelParams | undefined, args: unknown): ModelParams | undefined;
|
|
1376
1406
|
declare class Prompt<HasId extends boolean = true, HasVersion extends boolean = true> {
|
|
1377
1407
|
private metadata;
|
|
1378
1408
|
private defaults;
|
|
@@ -1458,11 +1488,16 @@ interface ExperimentSummary {
|
|
|
1458
1488
|
/**
|
|
1459
1489
|
* Summary of a dataset's data.
|
|
1460
1490
|
*
|
|
1461
|
-
* @property newRecords New or updated records added in this session.
|
|
1462
1491
|
* @property totalRecords Total records in the dataset.
|
|
1463
1492
|
*/
|
|
1464
1493
|
interface DataSummary {
|
|
1494
|
+
/**
|
|
1495
|
+
* New or updated records added in this session.
|
|
1496
|
+
*/
|
|
1465
1497
|
newRecords: number;
|
|
1498
|
+
/**
|
|
1499
|
+
* Total records in the dataset.
|
|
1500
|
+
*/
|
|
1466
1501
|
totalRecords: number;
|
|
1467
1502
|
}
|
|
1468
1503
|
/**
|
|
@@ -1479,7 +1514,7 @@ interface DatasetSummary {
|
|
|
1479
1514
|
datasetName: string;
|
|
1480
1515
|
projectUrl: string;
|
|
1481
1516
|
datasetUrl: string;
|
|
1482
|
-
dataSummary: DataSummary;
|
|
1517
|
+
dataSummary: DataSummary | undefined;
|
|
1483
1518
|
}
|
|
1484
1519
|
/**
|
|
1485
1520
|
* Allows accessing helper functions for testing.
|
|
@@ -1551,16 +1586,19 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1551
1586
|
object_id: z.ZodString;
|
|
1552
1587
|
id: z.ZodString;
|
|
1553
1588
|
_xact_id: z.ZodString;
|
|
1589
|
+
created: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1554
1590
|
}, "strip", z.ZodTypeAny, {
|
|
1555
1591
|
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
1556
1592
|
object_id: string;
|
|
1557
1593
|
id: string;
|
|
1558
1594
|
_xact_id: string;
|
|
1595
|
+
created?: string | null | undefined;
|
|
1559
1596
|
}, {
|
|
1560
1597
|
object_type: "function" | "experiment" | "dataset" | "prompt" | "prompt_session" | "project_logs";
|
|
1561
1598
|
object_id: string;
|
|
1562
1599
|
id: string;
|
|
1563
1600
|
_xact_id: string;
|
|
1601
|
+
created?: string | null | undefined;
|
|
1564
1602
|
}>>>;
|
|
1565
1603
|
format: z.ZodEnum<["llm", "code", "global"]>;
|
|
1566
1604
|
output_type: z.ZodEnum<["completion", "score", "any"]>;
|
|
@@ -1580,6 +1618,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1580
1618
|
object_id: string;
|
|
1581
1619
|
id: string;
|
|
1582
1620
|
_xact_id: string;
|
|
1621
|
+
created?: string | null | undefined;
|
|
1583
1622
|
} | null | undefined;
|
|
1584
1623
|
}, {
|
|
1585
1624
|
format: "code" | "global" | "llm";
|
|
@@ -1594,6 +1633,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1594
1633
|
object_id: string;
|
|
1595
1634
|
id: string;
|
|
1596
1635
|
_xact_id: string;
|
|
1636
|
+
created?: string | null | undefined;
|
|
1597
1637
|
} | null | undefined;
|
|
1598
1638
|
}>;
|
|
1599
1639
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1610,6 +1650,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1610
1650
|
object_id: string;
|
|
1611
1651
|
id: string;
|
|
1612
1652
|
_xact_id: string;
|
|
1653
|
+
created?: string | null | undefined;
|
|
1613
1654
|
} | null | undefined;
|
|
1614
1655
|
};
|
|
1615
1656
|
type: "progress";
|
|
@@ -1627,6 +1668,7 @@ declare const braintrustStreamChunkSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1627
1668
|
object_id: string;
|
|
1628
1669
|
id: string;
|
|
1629
1670
|
_xact_id: string;
|
|
1671
|
+
created?: string | null | undefined;
|
|
1630
1672
|
} | null | undefined;
|
|
1631
1673
|
};
|
|
1632
1674
|
type: "progress";
|
|
@@ -1937,6 +1979,7 @@ declare const braintrust_createFinalValuePassThroughStream: typeof createFinalVa
|
|
|
1937
1979
|
declare const braintrust_currentExperiment: typeof currentExperiment;
|
|
1938
1980
|
declare const braintrust_currentLogger: typeof currentLogger;
|
|
1939
1981
|
declare const braintrust_currentSpan: typeof currentSpan;
|
|
1982
|
+
declare const braintrust_deserializePlainStringAsJSON: typeof deserializePlainStringAsJSON;
|
|
1940
1983
|
declare const braintrust_devNullWritableStream: typeof devNullWritableStream;
|
|
1941
1984
|
declare const braintrust_flush: typeof flush;
|
|
1942
1985
|
declare const braintrust_getSpanParentObject: typeof getSpanParentObject;
|
|
@@ -1955,6 +1998,7 @@ declare const braintrust_newId: typeof newId;
|
|
|
1955
1998
|
declare const braintrust_parseCachedHeader: typeof parseCachedHeader;
|
|
1956
1999
|
declare const braintrust_permalink: typeof permalink;
|
|
1957
2000
|
declare const braintrust_renderMessage: typeof renderMessage;
|
|
2001
|
+
declare const braintrust_renderPromptParams: typeof renderPromptParams;
|
|
1958
2002
|
declare const braintrust_setFetch: typeof setFetch;
|
|
1959
2003
|
declare const braintrust_spanComponentsToObjectId: typeof spanComponentsToObjectId;
|
|
1960
2004
|
declare const braintrust_startSpan: typeof startSpan;
|
|
@@ -1971,7 +2015,7 @@ declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
|
|
|
1971
2015
|
declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
|
|
1972
2016
|
declare const braintrust_wrapTraced: typeof wrapTraced;
|
|
1973
2017
|
declare namespace braintrust {
|
|
1974
|
-
export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, 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_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, type braintrust_EndSpanArgs as EndSpanArgs, type braintrust_EvalCase as EvalCase, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, 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_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, 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, 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_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, 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_setFetch as setFetch, 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 };
|
|
2018
|
+
export { type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, 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_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, type braintrust_EndSpanArgs as EndSpanArgs, type braintrust_EvalCase as EvalCase, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, 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_NoopSpan as NoopSpan, type braintrust_ObjectMetadata as ObjectMetadata, 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, 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_flush as flush, 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_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 };
|
|
1975
2019
|
}
|
|
1976
2020
|
|
|
1977
|
-
export { type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, type BaseMetadata, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type DataSummary, Dataset, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, type EndSpanArgs, type EvalCase, Experiment, type ExperimentSummary, type Exportable, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type InitOptions, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NoopSpan, type ObjectMetadata, type PromiseUnless, Prompt, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type ScoreSummary, type SerializedBraintrustState, type SetCurrentArg, type Span, SpanImpl, type StartSpanArgs, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, devNullWritableStream, flush, getSpanParentObject, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, renderMessage, setFetch, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|
|
2021
|
+
export { type AnyDataset, Attachment, type AttachmentParams, type BackgroundLoggerOpts, type BaseMetadata, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, type DataSummary, Dataset, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, type EndSpanArgs, type EvalCase, Experiment, type ExperimentSummary, type Exportable, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type InitOptions, type InvokeFunctionArgs, type InvokeReturn, LEGACY_CACHED_HEADER, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NoopSpan, type ObjectMetadata, type PromiseUnless, Prompt, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, type ScoreSummary, type SerializedBraintrustState, type SetCurrentArg, type Span, SpanImpl, type StartSpanArgs, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, braintrust as default, deserializePlainStringAsJSON, devNullWritableStream, flush, getSpanParentObject, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, renderMessage, renderPromptParams, setFetch, spanComponentsToObjectId, startSpan, summarize, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|