@bitfab/sdk 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-2JQSYJJR.js → chunk-IFYX3KW6.js} +10 -3
- package/dist/{chunk-2JQSYJJR.js.map → chunk-IFYX3KW6.js.map} +1 -1
- package/dist/{chunk-FW7PZ3EP.js → chunk-RWZYZRYI.js} +2 -2
- package/dist/{chunk-SHJ3ABUG.js → chunk-U3AKIFW3.js} +162 -13
- package/dist/chunk-U3AKIFW3.js.map +1 -0
- package/dist/{chunk-RH4K4RSS.js → chunk-VEA6JOKL.js} +10 -3
- package/dist/{chunk-RH4K4RSS.js.map → chunk-VEA6JOKL.js.map} +1 -1
- package/dist/{http-GJZJKNZZ.js → http-JSBWHPNA.js} +2 -2
- package/dist/{http-PRCLI43J.js → http-UCJCOKW7.js} +2 -2
- package/dist/index.cjs +167 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +148 -3
- package/dist/index.d.ts +148 -3
- package/dist/index.js +5 -3
- package/dist/node.cjs +167 -10
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +5 -3
- package/dist/node.js.map +1 -1
- package/dist/{replay-MZYX4IFV.js → replay-HMMWDSLB.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-SHJ3ABUG.js.map +0 -1
- /package/dist/{chunk-FW7PZ3EP.js.map → chunk-RWZYZRYI.js.map} +0 -0
- /package/dist/{http-GJZJKNZZ.js.map → http-JSBWHPNA.js.map} +0 -0
- /package/dist/{http-PRCLI43J.js.map → http-UCJCOKW7.js.map} +0 -0
- /package/dist/{replay-MZYX4IFV.js.map → replay-HMMWDSLB.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -540,7 +540,11 @@ declare class HttpClient {
|
|
|
540
540
|
lookupFunction<T>(name: string): Promise<T>;
|
|
541
541
|
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
542
542
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
543
|
-
|
|
543
|
+
/**
|
|
544
|
+
* GET a JSON endpoint on the service with the client's API key. Throws a
|
|
545
|
+
* `BitfabError` carrying the status text for any non-2xx response.
|
|
546
|
+
*/
|
|
547
|
+
get<T>(endpoint: string): Promise<T>;
|
|
544
548
|
/**
|
|
545
549
|
* Queue an internal trace (from local BAML execution via `call()`) onto this
|
|
546
550
|
* client's batching transport. `functionId` moves into the payload because
|
|
@@ -574,6 +578,7 @@ declare class HttpClient {
|
|
|
574
578
|
appendContexts?: Record<string, unknown>[];
|
|
575
579
|
mergeMetadata?: Record<string, unknown>;
|
|
576
580
|
setSessionId?: string;
|
|
581
|
+
setName?: string;
|
|
577
582
|
}): Promise<void>;
|
|
578
583
|
/**
|
|
579
584
|
* Start a replay session by fetching historical traces.
|
|
@@ -1034,6 +1039,141 @@ declare class BitfabVercelAiHandler {
|
|
|
1034
1039
|
get middleware(): BitfabLanguageModelMiddleware;
|
|
1035
1040
|
}
|
|
1036
1041
|
|
|
1042
|
+
interface DatasetGraderRef {
|
|
1043
|
+
id: string;
|
|
1044
|
+
name: string | null;
|
|
1045
|
+
}
|
|
1046
|
+
interface Dataset {
|
|
1047
|
+
id: string;
|
|
1048
|
+
traceFunctionKey: string;
|
|
1049
|
+
name: string;
|
|
1050
|
+
description: string | null;
|
|
1051
|
+
traceCount: number;
|
|
1052
|
+
graders: DatasetGraderRef[];
|
|
1053
|
+
createdAt: string;
|
|
1054
|
+
updatedAt: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface SaveDatasetParams {
|
|
1057
|
+
traceFunctionKey: string;
|
|
1058
|
+
name: string;
|
|
1059
|
+
description?: string;
|
|
1060
|
+
}
|
|
1061
|
+
interface SaveDatasetResult {
|
|
1062
|
+
dataset: Dataset;
|
|
1063
|
+
created: boolean;
|
|
1064
|
+
}
|
|
1065
|
+
interface ListDatasetsParams {
|
|
1066
|
+
traceFunctionKey?: string;
|
|
1067
|
+
}
|
|
1068
|
+
interface DatasetTraceIds {
|
|
1069
|
+
datasetId: string;
|
|
1070
|
+
traceIds: string[];
|
|
1071
|
+
}
|
|
1072
|
+
interface AddDatasetTracesResult {
|
|
1073
|
+
dataset: Dataset;
|
|
1074
|
+
addedTraceIds: string[];
|
|
1075
|
+
alreadyPresentTraceIds: string[];
|
|
1076
|
+
skippedTraceIds: string[];
|
|
1077
|
+
}
|
|
1078
|
+
interface RemoveDatasetTracesResult {
|
|
1079
|
+
dataset: Dataset;
|
|
1080
|
+
removedTraceIds: string[];
|
|
1081
|
+
notPresentTraceIds: string[];
|
|
1082
|
+
}
|
|
1083
|
+
interface AddDatasetGradersResult {
|
|
1084
|
+
dataset: Dataset;
|
|
1085
|
+
addedGraderIds: string[];
|
|
1086
|
+
alreadyAssignedGraderIds: string[];
|
|
1087
|
+
skippedGraderIds: string[];
|
|
1088
|
+
}
|
|
1089
|
+
interface RemoveDatasetGradersResult {
|
|
1090
|
+
dataset: Dataset;
|
|
1091
|
+
removedGraderIds: string[];
|
|
1092
|
+
notAssignedGraderIds: string[];
|
|
1093
|
+
}
|
|
1094
|
+
type GraderRerunStatus = "pending" | "running" | "completed" | "errored";
|
|
1095
|
+
interface GraderRerunProgress {
|
|
1096
|
+
completedTraces: number;
|
|
1097
|
+
totalTraces: number;
|
|
1098
|
+
graderCount: number;
|
|
1099
|
+
}
|
|
1100
|
+
interface GraderRerunResult {
|
|
1101
|
+
tracesGraded: number;
|
|
1102
|
+
gradersRun: number;
|
|
1103
|
+
}
|
|
1104
|
+
interface GraderRerun {
|
|
1105
|
+
id: string;
|
|
1106
|
+
status: GraderRerunStatus;
|
|
1107
|
+
graderIds: string[];
|
|
1108
|
+
progress: GraderRerunProgress | null;
|
|
1109
|
+
result: GraderRerunResult | null;
|
|
1110
|
+
error: string | null;
|
|
1111
|
+
createdAt: string;
|
|
1112
|
+
updatedAt: string;
|
|
1113
|
+
}
|
|
1114
|
+
interface RerunGradersOptions {
|
|
1115
|
+
graderIds?: string[];
|
|
1116
|
+
wait?: boolean;
|
|
1117
|
+
timeoutMs?: number;
|
|
1118
|
+
pollIntervalMs?: number;
|
|
1119
|
+
}
|
|
1120
|
+
interface RerunGradersResult {
|
|
1121
|
+
run: GraderRerun;
|
|
1122
|
+
joinedExisting: boolean;
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Dataset operations for the authenticated organization, reached as
|
|
1126
|
+
* `client.datasets`. A dataset is a named bucket of traces scoped to one trace
|
|
1127
|
+
* function. Experiments replay against it and its graders score its members.
|
|
1128
|
+
*/
|
|
1129
|
+
declare class DatasetsClient {
|
|
1130
|
+
private readonly httpClient;
|
|
1131
|
+
constructor(httpClient: HttpClient);
|
|
1132
|
+
/**
|
|
1133
|
+
* Create a dataset, or update the one already named this way under the same
|
|
1134
|
+
* trace function. `created` reports which happened. An omitted description
|
|
1135
|
+
* leaves an existing one untouched.
|
|
1136
|
+
*/
|
|
1137
|
+
save(params: SaveDatasetParams): Promise<SaveDatasetResult>;
|
|
1138
|
+
/**
|
|
1139
|
+
* List datasets, scoped to one trace function when `traceFunctionKey` is
|
|
1140
|
+
* given and organization-wide otherwise.
|
|
1141
|
+
*/
|
|
1142
|
+
list(params?: ListDatasetsParams): Promise<Dataset[]>;
|
|
1143
|
+
/** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
|
|
1144
|
+
get(datasetId: string): Promise<Dataset>;
|
|
1145
|
+
/** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
|
|
1146
|
+
listTraces(datasetId: string): Promise<DatasetTraceIds>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Add traces to the dataset (1 to 100 ids per call). Traces outside the
|
|
1149
|
+
* organization or under another trace function are reported in
|
|
1150
|
+
* `skippedTraceIds` rather than failing the call.
|
|
1151
|
+
*/
|
|
1152
|
+
addTraces(datasetId: string, traceIds: string[]): Promise<AddDatasetTracesResult>;
|
|
1153
|
+
/** Remove traces from the dataset. The traces themselves are never deleted. */
|
|
1154
|
+
removeTraces(datasetId: string, traceIds: string[]): Promise<RemoveDatasetTracesResult>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Assign graders to the dataset (1 to 100 ids per call). Graders outside the
|
|
1157
|
+
* organization or under another trace function are reported in
|
|
1158
|
+
* `skippedGraderIds` rather than failing the call.
|
|
1159
|
+
*/
|
|
1160
|
+
addGraders(datasetId: string, graderIds: string[]): Promise<AddDatasetGradersResult>;
|
|
1161
|
+
/** Unassign graders from the dataset. */
|
|
1162
|
+
removeGraders(datasetId: string, graderIds: string[]): Promise<RemoveDatasetGradersResult>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Re-run graders over every trace in the dataset. Defaults to every assigned
|
|
1165
|
+
* grader; an unassigned id is rejected. Waits for the run to finish (up to
|
|
1166
|
+
* `timeoutMs`, default 90s) unless `wait` is `false`, and returns the last
|
|
1167
|
+
* run state seen either way. A request matching an in-flight run joins it.
|
|
1168
|
+
*/
|
|
1169
|
+
rerunGraders(datasetId: string, options?: RerunGradersOptions): Promise<RerunGradersResult>;
|
|
1170
|
+
/**
|
|
1171
|
+
* The dataset's active grader re-run, or the run named by `runId`. Returns
|
|
1172
|
+
* `null` when nothing is active or the run does not belong to this dataset.
|
|
1173
|
+
*/
|
|
1174
|
+
getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1037
1177
|
/**
|
|
1038
1178
|
* LangGraph/LangChain callback handler for Bitfab tracing.
|
|
1039
1179
|
*
|
|
@@ -2021,6 +2161,7 @@ interface DetachedTrace {
|
|
|
2021
2161
|
* Rejects if the server refused the update.
|
|
2022
2162
|
*/
|
|
2023
2163
|
setSessionId(sessionId: string): Promise<void>;
|
|
2164
|
+
setName(name: string): Promise<void>;
|
|
2024
2165
|
}
|
|
2025
2166
|
/**
|
|
2026
2167
|
* A handle to the current active trace, allowing trace-level context to be set.
|
|
@@ -2030,6 +2171,7 @@ interface CurrentTrace {
|
|
|
2030
2171
|
* Set the session ID for this trace. Stored in the database session_id column.
|
|
2031
2172
|
*/
|
|
2032
2173
|
setSessionId(sessionId: string): void;
|
|
2174
|
+
setName(name: string): void;
|
|
2033
2175
|
/**
|
|
2034
2176
|
* Set metadata for this trace. Stored in rawData.metadata.
|
|
2035
2177
|
* Subsequent calls merge with existing metadata, with later values taking precedence.
|
|
@@ -2272,6 +2414,8 @@ declare class Bitfab {
|
|
|
2272
2414
|
private readonly explicitlyEnabled;
|
|
2273
2415
|
private readonly strict;
|
|
2274
2416
|
private readonly httpClient;
|
|
2417
|
+
/** Dataset operations for the authenticated organization. */
|
|
2418
|
+
readonly datasets: DatasetsClient;
|
|
2275
2419
|
private readonly bamlClient;
|
|
2276
2420
|
private readonly dbSnapshot;
|
|
2277
2421
|
private readonly autoTracePolicyRefreshes;
|
|
@@ -2777,6 +2921,7 @@ declare class Bitfab {
|
|
|
2777
2921
|
*/
|
|
2778
2922
|
metadata?: Record<string, unknown>;
|
|
2779
2923
|
sessionId?: string;
|
|
2924
|
+
name?: string;
|
|
2780
2925
|
spanName?: string;
|
|
2781
2926
|
spanType?: SpanType;
|
|
2782
2927
|
}): string;
|
|
@@ -2955,7 +3100,7 @@ declare class BitfabFunction {
|
|
|
2955
3100
|
/**
|
|
2956
3101
|
* SDK version from package.json (injected at build time)
|
|
2957
3102
|
*/
|
|
2958
|
-
declare const __version__ = "0.
|
|
3103
|
+
declare const __version__ = "0.41.0";
|
|
2959
3104
|
|
|
2960
3105
|
/**
|
|
2961
3106
|
* Constants for the Bitfab SDK.
|
|
@@ -3083,4 +3228,4 @@ interface SeedResult {
|
|
|
3083
3228
|
*/
|
|
3084
3229
|
declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, cases: readonly SeedCase[]): Promise<SeedResult>;
|
|
3085
3230
|
|
|
3086
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, HttpClient, type LangGraphIntegrationOptions, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SeedCase, type SeedResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
|
3231
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
package/dist/index.d.ts
CHANGED
|
@@ -540,7 +540,11 @@ declare class HttpClient {
|
|
|
540
540
|
lookupFunction<T>(name: string): Promise<T>;
|
|
541
541
|
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
542
542
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
543
|
-
|
|
543
|
+
/**
|
|
544
|
+
* GET a JSON endpoint on the service with the client's API key. Throws a
|
|
545
|
+
* `BitfabError` carrying the status text for any non-2xx response.
|
|
546
|
+
*/
|
|
547
|
+
get<T>(endpoint: string): Promise<T>;
|
|
544
548
|
/**
|
|
545
549
|
* Queue an internal trace (from local BAML execution via `call()`) onto this
|
|
546
550
|
* client's batching transport. `functionId` moves into the payload because
|
|
@@ -574,6 +578,7 @@ declare class HttpClient {
|
|
|
574
578
|
appendContexts?: Record<string, unknown>[];
|
|
575
579
|
mergeMetadata?: Record<string, unknown>;
|
|
576
580
|
setSessionId?: string;
|
|
581
|
+
setName?: string;
|
|
577
582
|
}): Promise<void>;
|
|
578
583
|
/**
|
|
579
584
|
* Start a replay session by fetching historical traces.
|
|
@@ -1034,6 +1039,141 @@ declare class BitfabVercelAiHandler {
|
|
|
1034
1039
|
get middleware(): BitfabLanguageModelMiddleware;
|
|
1035
1040
|
}
|
|
1036
1041
|
|
|
1042
|
+
interface DatasetGraderRef {
|
|
1043
|
+
id: string;
|
|
1044
|
+
name: string | null;
|
|
1045
|
+
}
|
|
1046
|
+
interface Dataset {
|
|
1047
|
+
id: string;
|
|
1048
|
+
traceFunctionKey: string;
|
|
1049
|
+
name: string;
|
|
1050
|
+
description: string | null;
|
|
1051
|
+
traceCount: number;
|
|
1052
|
+
graders: DatasetGraderRef[];
|
|
1053
|
+
createdAt: string;
|
|
1054
|
+
updatedAt: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface SaveDatasetParams {
|
|
1057
|
+
traceFunctionKey: string;
|
|
1058
|
+
name: string;
|
|
1059
|
+
description?: string;
|
|
1060
|
+
}
|
|
1061
|
+
interface SaveDatasetResult {
|
|
1062
|
+
dataset: Dataset;
|
|
1063
|
+
created: boolean;
|
|
1064
|
+
}
|
|
1065
|
+
interface ListDatasetsParams {
|
|
1066
|
+
traceFunctionKey?: string;
|
|
1067
|
+
}
|
|
1068
|
+
interface DatasetTraceIds {
|
|
1069
|
+
datasetId: string;
|
|
1070
|
+
traceIds: string[];
|
|
1071
|
+
}
|
|
1072
|
+
interface AddDatasetTracesResult {
|
|
1073
|
+
dataset: Dataset;
|
|
1074
|
+
addedTraceIds: string[];
|
|
1075
|
+
alreadyPresentTraceIds: string[];
|
|
1076
|
+
skippedTraceIds: string[];
|
|
1077
|
+
}
|
|
1078
|
+
interface RemoveDatasetTracesResult {
|
|
1079
|
+
dataset: Dataset;
|
|
1080
|
+
removedTraceIds: string[];
|
|
1081
|
+
notPresentTraceIds: string[];
|
|
1082
|
+
}
|
|
1083
|
+
interface AddDatasetGradersResult {
|
|
1084
|
+
dataset: Dataset;
|
|
1085
|
+
addedGraderIds: string[];
|
|
1086
|
+
alreadyAssignedGraderIds: string[];
|
|
1087
|
+
skippedGraderIds: string[];
|
|
1088
|
+
}
|
|
1089
|
+
interface RemoveDatasetGradersResult {
|
|
1090
|
+
dataset: Dataset;
|
|
1091
|
+
removedGraderIds: string[];
|
|
1092
|
+
notAssignedGraderIds: string[];
|
|
1093
|
+
}
|
|
1094
|
+
type GraderRerunStatus = "pending" | "running" | "completed" | "errored";
|
|
1095
|
+
interface GraderRerunProgress {
|
|
1096
|
+
completedTraces: number;
|
|
1097
|
+
totalTraces: number;
|
|
1098
|
+
graderCount: number;
|
|
1099
|
+
}
|
|
1100
|
+
interface GraderRerunResult {
|
|
1101
|
+
tracesGraded: number;
|
|
1102
|
+
gradersRun: number;
|
|
1103
|
+
}
|
|
1104
|
+
interface GraderRerun {
|
|
1105
|
+
id: string;
|
|
1106
|
+
status: GraderRerunStatus;
|
|
1107
|
+
graderIds: string[];
|
|
1108
|
+
progress: GraderRerunProgress | null;
|
|
1109
|
+
result: GraderRerunResult | null;
|
|
1110
|
+
error: string | null;
|
|
1111
|
+
createdAt: string;
|
|
1112
|
+
updatedAt: string;
|
|
1113
|
+
}
|
|
1114
|
+
interface RerunGradersOptions {
|
|
1115
|
+
graderIds?: string[];
|
|
1116
|
+
wait?: boolean;
|
|
1117
|
+
timeoutMs?: number;
|
|
1118
|
+
pollIntervalMs?: number;
|
|
1119
|
+
}
|
|
1120
|
+
interface RerunGradersResult {
|
|
1121
|
+
run: GraderRerun;
|
|
1122
|
+
joinedExisting: boolean;
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Dataset operations for the authenticated organization, reached as
|
|
1126
|
+
* `client.datasets`. A dataset is a named bucket of traces scoped to one trace
|
|
1127
|
+
* function. Experiments replay against it and its graders score its members.
|
|
1128
|
+
*/
|
|
1129
|
+
declare class DatasetsClient {
|
|
1130
|
+
private readonly httpClient;
|
|
1131
|
+
constructor(httpClient: HttpClient);
|
|
1132
|
+
/**
|
|
1133
|
+
* Create a dataset, or update the one already named this way under the same
|
|
1134
|
+
* trace function. `created` reports which happened. An omitted description
|
|
1135
|
+
* leaves an existing one untouched.
|
|
1136
|
+
*/
|
|
1137
|
+
save(params: SaveDatasetParams): Promise<SaveDatasetResult>;
|
|
1138
|
+
/**
|
|
1139
|
+
* List datasets, scoped to one trace function when `traceFunctionKey` is
|
|
1140
|
+
* given and organization-wide otherwise.
|
|
1141
|
+
*/
|
|
1142
|
+
list(params?: ListDatasetsParams): Promise<Dataset[]>;
|
|
1143
|
+
/** Fetch one dataset by id. Rejects with a 404 `BitfabError` when it is not in this organization. */
|
|
1144
|
+
get(datasetId: string): Promise<Dataset>;
|
|
1145
|
+
/** The ids of every trace in the dataset, the same membership a replay with `datasetId` selects. */
|
|
1146
|
+
listTraces(datasetId: string): Promise<DatasetTraceIds>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Add traces to the dataset (1 to 100 ids per call). Traces outside the
|
|
1149
|
+
* organization or under another trace function are reported in
|
|
1150
|
+
* `skippedTraceIds` rather than failing the call.
|
|
1151
|
+
*/
|
|
1152
|
+
addTraces(datasetId: string, traceIds: string[]): Promise<AddDatasetTracesResult>;
|
|
1153
|
+
/** Remove traces from the dataset. The traces themselves are never deleted. */
|
|
1154
|
+
removeTraces(datasetId: string, traceIds: string[]): Promise<RemoveDatasetTracesResult>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Assign graders to the dataset (1 to 100 ids per call). Graders outside the
|
|
1157
|
+
* organization or under another trace function are reported in
|
|
1158
|
+
* `skippedGraderIds` rather than failing the call.
|
|
1159
|
+
*/
|
|
1160
|
+
addGraders(datasetId: string, graderIds: string[]): Promise<AddDatasetGradersResult>;
|
|
1161
|
+
/** Unassign graders from the dataset. */
|
|
1162
|
+
removeGraders(datasetId: string, graderIds: string[]): Promise<RemoveDatasetGradersResult>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Re-run graders over every trace in the dataset. Defaults to every assigned
|
|
1165
|
+
* grader; an unassigned id is rejected. Waits for the run to finish (up to
|
|
1166
|
+
* `timeoutMs`, default 90s) unless `wait` is `false`, and returns the last
|
|
1167
|
+
* run state seen either way. A request matching an in-flight run joins it.
|
|
1168
|
+
*/
|
|
1169
|
+
rerunGraders(datasetId: string, options?: RerunGradersOptions): Promise<RerunGradersResult>;
|
|
1170
|
+
/**
|
|
1171
|
+
* The dataset's active grader re-run, or the run named by `runId`. Returns
|
|
1172
|
+
* `null` when nothing is active or the run does not belong to this dataset.
|
|
1173
|
+
*/
|
|
1174
|
+
getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1037
1177
|
/**
|
|
1038
1178
|
* LangGraph/LangChain callback handler for Bitfab tracing.
|
|
1039
1179
|
*
|
|
@@ -2021,6 +2161,7 @@ interface DetachedTrace {
|
|
|
2021
2161
|
* Rejects if the server refused the update.
|
|
2022
2162
|
*/
|
|
2023
2163
|
setSessionId(sessionId: string): Promise<void>;
|
|
2164
|
+
setName(name: string): Promise<void>;
|
|
2024
2165
|
}
|
|
2025
2166
|
/**
|
|
2026
2167
|
* A handle to the current active trace, allowing trace-level context to be set.
|
|
@@ -2030,6 +2171,7 @@ interface CurrentTrace {
|
|
|
2030
2171
|
* Set the session ID for this trace. Stored in the database session_id column.
|
|
2031
2172
|
*/
|
|
2032
2173
|
setSessionId(sessionId: string): void;
|
|
2174
|
+
setName(name: string): void;
|
|
2033
2175
|
/**
|
|
2034
2176
|
* Set metadata for this trace. Stored in rawData.metadata.
|
|
2035
2177
|
* Subsequent calls merge with existing metadata, with later values taking precedence.
|
|
@@ -2272,6 +2414,8 @@ declare class Bitfab {
|
|
|
2272
2414
|
private readonly explicitlyEnabled;
|
|
2273
2415
|
private readonly strict;
|
|
2274
2416
|
private readonly httpClient;
|
|
2417
|
+
/** Dataset operations for the authenticated organization. */
|
|
2418
|
+
readonly datasets: DatasetsClient;
|
|
2275
2419
|
private readonly bamlClient;
|
|
2276
2420
|
private readonly dbSnapshot;
|
|
2277
2421
|
private readonly autoTracePolicyRefreshes;
|
|
@@ -2777,6 +2921,7 @@ declare class Bitfab {
|
|
|
2777
2921
|
*/
|
|
2778
2922
|
metadata?: Record<string, unknown>;
|
|
2779
2923
|
sessionId?: string;
|
|
2924
|
+
name?: string;
|
|
2780
2925
|
spanName?: string;
|
|
2781
2926
|
spanType?: SpanType;
|
|
2782
2927
|
}): string;
|
|
@@ -2955,7 +3100,7 @@ declare class BitfabFunction {
|
|
|
2955
3100
|
/**
|
|
2956
3101
|
* SDK version from package.json (injected at build time)
|
|
2957
3102
|
*/
|
|
2958
|
-
declare const __version__ = "0.
|
|
3103
|
+
declare const __version__ = "0.41.0";
|
|
2959
3104
|
|
|
2960
3105
|
/**
|
|
2961
3106
|
* Constants for the Bitfab SDK.
|
|
@@ -3083,4 +3228,4 @@ interface SeedResult {
|
|
|
3083
3228
|
*/
|
|
3084
3229
|
declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, cases: readonly SeedCase[]): Promise<SeedResult>;
|
|
3085
3230
|
|
|
3086
|
-
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, HttpClient, type LangGraphIntegrationOptions, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, SUPPORTED_PROVIDERS, type SeedCase, type SeedResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
|
3231
|
+
export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
BitfabOpenAIAgentHandler,
|
|
8
8
|
BitfabOpenAITracingProcessor,
|
|
9
9
|
BitfabVercelAiHandler,
|
|
10
|
+
DatasetsClient,
|
|
10
11
|
SUPPORTED_PROVIDERS,
|
|
11
12
|
defineReplayRegistry,
|
|
12
13
|
finalizers,
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
getCurrentSpan,
|
|
15
16
|
getCurrentTrace,
|
|
16
17
|
seedFromRegistry
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-U3AKIFW3.js";
|
|
18
19
|
import "./chunk-ZUD7OFYB.js";
|
|
19
20
|
import {
|
|
20
21
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -23,14 +24,14 @@ import {
|
|
|
23
24
|
ReplayError,
|
|
24
25
|
reportReplayProgress,
|
|
25
26
|
serializeReplayResult
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-RWZYZRYI.js";
|
|
27
28
|
import {
|
|
28
29
|
BitfabError,
|
|
29
30
|
DEFAULT_SERVICE_URL,
|
|
30
31
|
HttpClient,
|
|
31
32
|
__version__,
|
|
32
33
|
flushTraces
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-IFYX3KW6.js";
|
|
34
35
|
import "./chunk-H6LZRFMN.js";
|
|
35
36
|
export {
|
|
36
37
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -45,6 +46,7 @@ export {
|
|
|
45
46
|
BitfabOpenAITracingProcessor,
|
|
46
47
|
BitfabVercelAiHandler,
|
|
47
48
|
DEFAULT_SERVICE_URL,
|
|
49
|
+
DatasetsClient,
|
|
48
50
|
DbBranchReplayError,
|
|
49
51
|
HttpClient,
|
|
50
52
|
NO_MOCK_OVERRIDE,
|