braintrust 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/dist/index.js +16 -3
- package/dev/dist/index.mjs +16 -3
- package/dist/browser.js +7 -2
- package/dist/browser.mjs +7 -2
- package/dist/cli.js +20 -5
- package/dist/index.d.mts +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.js +674 -70
- package/dist/index.mjs +627 -23
- package/package.json +4 -2
- package/util/dist/index.js +3 -1
- package/util/dist/index.mjs +3 -1
package/dev/dist/index.js
CHANGED
|
@@ -848,7 +848,9 @@ function mergeDictsWithPathsHelper({
|
|
|
848
848
|
mergePaths
|
|
849
849
|
});
|
|
850
850
|
} else {
|
|
851
|
-
|
|
851
|
+
if (mergeFromV !== void 0) {
|
|
852
|
+
mergeInto[k] = mergeFromV;
|
|
853
|
+
}
|
|
852
854
|
}
|
|
853
855
|
});
|
|
854
856
|
return mergeInto;
|
|
@@ -7828,7 +7830,10 @@ Error: ${errorText}`;
|
|
|
7828
7830
|
limit: INTERNAL_BTQL_LIMIT
|
|
7829
7831
|
},
|
|
7830
7832
|
use_columnstore: false,
|
|
7831
|
-
brainstore_realtime: true
|
|
7833
|
+
brainstore_realtime: true,
|
|
7834
|
+
...this.pinnedVersion !== void 0 ? {
|
|
7835
|
+
version: this.pinnedVersion
|
|
7836
|
+
} : {}
|
|
7832
7837
|
},
|
|
7833
7838
|
{ headers: { "Accept-Encoding": "gzip" } }
|
|
7834
7839
|
);
|
|
@@ -11392,9 +11397,17 @@ function makeCheckAuthorized(allowedOrgName) {
|
|
|
11392
11397
|
return next(_httperrors2.default.call(void 0, 401, "Unauthorized"));
|
|
11393
11398
|
}
|
|
11394
11399
|
try {
|
|
11400
|
+
const orgName = parseHeader(req.headers, "x-bt-org-name");
|
|
11401
|
+
if (!orgName) {
|
|
11402
|
+
return next(_httperrors2.default.call(void 0, 400, "Missing x-bt-org-name header"));
|
|
11403
|
+
}
|
|
11404
|
+
if (allowedOrgName && allowedOrgName !== orgName) {
|
|
11405
|
+
const errorMessage = `Org '${orgName}' is not allowed. Only org '${allowedOrgName}' is allowed.`;
|
|
11406
|
+
return next(_httperrors2.default.call(void 0, 403, errorMessage));
|
|
11407
|
+
}
|
|
11395
11408
|
const state = await cachedLogin({
|
|
11396
11409
|
apiKey: _optionalChain([req, 'access', _124 => _124.ctx, 'optionalAccess', _125 => _125.token]),
|
|
11397
|
-
orgName
|
|
11410
|
+
orgName
|
|
11398
11411
|
});
|
|
11399
11412
|
req.ctx.state = state;
|
|
11400
11413
|
next();
|
package/dev/dist/index.mjs
CHANGED
|
@@ -848,7 +848,9 @@ function mergeDictsWithPathsHelper({
|
|
|
848
848
|
mergePaths
|
|
849
849
|
});
|
|
850
850
|
} else {
|
|
851
|
-
|
|
851
|
+
if (mergeFromV !== void 0) {
|
|
852
|
+
mergeInto[k] = mergeFromV;
|
|
853
|
+
}
|
|
852
854
|
}
|
|
853
855
|
});
|
|
854
856
|
return mergeInto;
|
|
@@ -7828,7 +7830,10 @@ Error: ${errorText}`;
|
|
|
7828
7830
|
limit: INTERNAL_BTQL_LIMIT
|
|
7829
7831
|
},
|
|
7830
7832
|
use_columnstore: false,
|
|
7831
|
-
brainstore_realtime: true
|
|
7833
|
+
brainstore_realtime: true,
|
|
7834
|
+
...this.pinnedVersion !== void 0 ? {
|
|
7835
|
+
version: this.pinnedVersion
|
|
7836
|
+
} : {}
|
|
7832
7837
|
},
|
|
7833
7838
|
{ headers: { "Accept-Encoding": "gzip" } }
|
|
7834
7839
|
);
|
|
@@ -11392,9 +11397,17 @@ function makeCheckAuthorized(allowedOrgName) {
|
|
|
11392
11397
|
return next(createError(401, "Unauthorized"));
|
|
11393
11398
|
}
|
|
11394
11399
|
try {
|
|
11400
|
+
const orgName = parseHeader(req.headers, "x-bt-org-name");
|
|
11401
|
+
if (!orgName) {
|
|
11402
|
+
return next(createError(400, "Missing x-bt-org-name header"));
|
|
11403
|
+
}
|
|
11404
|
+
if (allowedOrgName && allowedOrgName !== orgName) {
|
|
11405
|
+
const errorMessage = `Org '${orgName}' is not allowed. Only org '${allowedOrgName}' is allowed.`;
|
|
11406
|
+
return next(createError(403, errorMessage));
|
|
11407
|
+
}
|
|
11395
11408
|
const state = await cachedLogin({
|
|
11396
11409
|
apiKey: req.ctx?.token,
|
|
11397
|
-
orgName
|
|
11410
|
+
orgName
|
|
11398
11411
|
});
|
|
11399
11412
|
req.ctx.state = state;
|
|
11400
11413
|
next();
|
package/dist/browser.js
CHANGED
|
@@ -845,7 +845,9 @@ function mergeDictsWithPathsHelper({
|
|
|
845
845
|
mergePaths
|
|
846
846
|
});
|
|
847
847
|
} else {
|
|
848
|
-
|
|
848
|
+
if (mergeFromV !== void 0) {
|
|
849
|
+
mergeInto[k] = mergeFromV;
|
|
850
|
+
}
|
|
849
851
|
}
|
|
850
852
|
});
|
|
851
853
|
return mergeInto;
|
|
@@ -8505,7 +8507,10 @@ Error: ${errorText}`;
|
|
|
8505
8507
|
limit: INTERNAL_BTQL_LIMIT
|
|
8506
8508
|
},
|
|
8507
8509
|
use_columnstore: false,
|
|
8508
|
-
brainstore_realtime: true
|
|
8510
|
+
brainstore_realtime: true,
|
|
8511
|
+
...this.pinnedVersion !== void 0 ? {
|
|
8512
|
+
version: this.pinnedVersion
|
|
8513
|
+
} : {}
|
|
8509
8514
|
},
|
|
8510
8515
|
{ headers: { "Accept-Encoding": "gzip" } }
|
|
8511
8516
|
);
|
package/dist/browser.mjs
CHANGED
|
@@ -845,7 +845,9 @@ function mergeDictsWithPathsHelper({
|
|
|
845
845
|
mergePaths
|
|
846
846
|
});
|
|
847
847
|
} else {
|
|
848
|
-
|
|
848
|
+
if (mergeFromV !== void 0) {
|
|
849
|
+
mergeInto[k] = mergeFromV;
|
|
850
|
+
}
|
|
849
851
|
}
|
|
850
852
|
});
|
|
851
853
|
return mergeInto;
|
|
@@ -8505,7 +8507,10 @@ Error: ${errorText}`;
|
|
|
8505
8507
|
limit: INTERNAL_BTQL_LIMIT
|
|
8506
8508
|
},
|
|
8507
8509
|
use_columnstore: false,
|
|
8508
|
-
brainstore_realtime: true
|
|
8510
|
+
brainstore_realtime: true,
|
|
8511
|
+
...this.pinnedVersion !== void 0 ? {
|
|
8512
|
+
version: this.pinnedVersion
|
|
8513
|
+
} : {}
|
|
8509
8514
|
},
|
|
8510
8515
|
{ headers: { "Accept-Encoding": "gzip" } }
|
|
8511
8516
|
);
|
package/dist/cli.js
CHANGED
|
@@ -2052,7 +2052,9 @@ function mergeDictsWithPathsHelper({
|
|
|
2052
2052
|
mergePaths
|
|
2053
2053
|
});
|
|
2054
2054
|
} else {
|
|
2055
|
-
|
|
2055
|
+
if (mergeFromV !== void 0) {
|
|
2056
|
+
mergeInto[k] = mergeFromV;
|
|
2057
|
+
}
|
|
2056
2058
|
}
|
|
2057
2059
|
});
|
|
2058
2060
|
return mergeInto;
|
|
@@ -9071,7 +9073,10 @@ Error: ${errorText}`;
|
|
|
9071
9073
|
limit: INTERNAL_BTQL_LIMIT
|
|
9072
9074
|
},
|
|
9073
9075
|
use_columnstore: false,
|
|
9074
|
-
brainstore_realtime: true
|
|
9076
|
+
brainstore_realtime: true,
|
|
9077
|
+
...this.pinnedVersion !== void 0 ? {
|
|
9078
|
+
version: this.pinnedVersion
|
|
9079
|
+
} : {}
|
|
9075
9080
|
},
|
|
9076
9081
|
{ headers: { "Accept-Encoding": "gzip" } }
|
|
9077
9082
|
);
|
|
@@ -10228,7 +10233,7 @@ var require_package = __commonJS({
|
|
|
10228
10233
|
"package.json"(exports2, module2) {
|
|
10229
10234
|
module2.exports = {
|
|
10230
10235
|
name: "braintrust",
|
|
10231
|
-
version: "0.4.
|
|
10236
|
+
version: "0.4.6",
|
|
10232
10237
|
description: "SDK for integrating Braintrust",
|
|
10233
10238
|
repository: {
|
|
10234
10239
|
type: "git",
|
|
@@ -10284,10 +10289,11 @@ var require_package = __commonJS({
|
|
|
10284
10289
|
watch: "tsup --watch",
|
|
10285
10290
|
clean: "rm -r dist/* && rm -r dev/dist/*",
|
|
10286
10291
|
docs: "npx typedoc --options typedoc.json src/index.ts",
|
|
10287
|
-
test: "vitest run --exclude src/wrappers/anthropic.test.ts --exclude src/wrappers/oai.test.ts --exclude src/otel.test.ts --exclude src/otel-no-deps.test.ts --exclude src/wrappers/ai-sdk-v1.test.ts --exclude src/wrappers/ai-sdk-v2.test.ts --exclude src/wrappers/ai-sdk-v3.test.ts --exclude src/wrappers/mastra.test.ts --exclude src/wrappers/claude-agent-sdk.test.ts",
|
|
10292
|
+
test: "vitest run --exclude src/wrappers/anthropic.test.ts --exclude src/wrappers/oai.test.ts --exclude src/otel.test.ts --exclude src/otel-no-deps.test.ts --exclude src/wrappers/ai-sdk-v1.test.ts --exclude src/wrappers/ai-sdk-v2.test.ts --exclude src/wrappers/ai-sdk-v3.test.ts --exclude src/wrappers/mastra.test.ts --exclude src/wrappers/claude-agent-sdk.test.ts --exclude src/wrappers/google-genai.test.ts",
|
|
10288
10293
|
"test:anthropic": "vitest run src/wrappers/anthropic.test.ts",
|
|
10289
10294
|
"test:openai": "vitest run src/wrappers/oai.test.ts",
|
|
10290
10295
|
"test:otel": "vitest run src/otel.test.ts",
|
|
10296
|
+
"test:google-genai": "vitest run src/wrappers/google-genai.test.ts",
|
|
10291
10297
|
"test:otel-no-deps": "vitest run src/otel-no-deps.test.ts --reporter=verbose",
|
|
10292
10298
|
"test:ai-sdk-v1": "vitest run src/wrappers/ai-sdk-v1.test.ts",
|
|
10293
10299
|
"test:ai-sdk-v2": "vitest run src/wrappers/ai-sdk-v2.test.ts src/wrappers/ai-sdk-v1.test.ts",
|
|
@@ -10300,6 +10306,7 @@ var require_package = __commonJS({
|
|
|
10300
10306
|
devDependencies: {
|
|
10301
10307
|
"@ai-sdk/anthropic": "^1.0.5",
|
|
10302
10308
|
"@anthropic-ai/sdk": "^0.60.0",
|
|
10309
|
+
"@google/genai": "^1.25.0",
|
|
10303
10310
|
"@jest/globals": "^29.7.0",
|
|
10304
10311
|
"@nodelib/fs.walk": "^1.2.8",
|
|
10305
10312
|
"@openai/agents": "^0.0.14",
|
|
@@ -13731,9 +13738,17 @@ function makeCheckAuthorized(allowedOrgName) {
|
|
|
13731
13738
|
return next((0, import_http_errors.default)(401, "Unauthorized"));
|
|
13732
13739
|
}
|
|
13733
13740
|
try {
|
|
13741
|
+
const orgName = parseHeader(req.headers, "x-bt-org-name");
|
|
13742
|
+
if (!orgName) {
|
|
13743
|
+
return next((0, import_http_errors.default)(400, "Missing x-bt-org-name header"));
|
|
13744
|
+
}
|
|
13745
|
+
if (allowedOrgName && allowedOrgName !== orgName) {
|
|
13746
|
+
const errorMessage = `Org '${orgName}' is not allowed. Only org '${allowedOrgName}' is allowed.`;
|
|
13747
|
+
return next((0, import_http_errors.default)(403, errorMessage));
|
|
13748
|
+
}
|
|
13734
13749
|
const state = await cachedLogin({
|
|
13735
13750
|
apiKey: req.ctx?.token,
|
|
13736
|
-
orgName
|
|
13751
|
+
orgName
|
|
13737
13752
|
});
|
|
13738
13753
|
req.ctx.state = state;
|
|
13739
13754
|
next();
|
package/dist/index.d.mts
CHANGED
|
@@ -21363,6 +21363,8 @@ interface MiddlewareConfig {
|
|
|
21363
21363
|
debug?: boolean;
|
|
21364
21364
|
/** Name identifier for the middleware instance */
|
|
21365
21365
|
name?: string;
|
|
21366
|
+
/** Span info from loadPrompt for prompt version tracking */
|
|
21367
|
+
spanInfo?: CompiledPrompt<"chat">["span_info"];
|
|
21366
21368
|
}
|
|
21367
21369
|
/**
|
|
21368
21370
|
* Creates a Braintrust middleware for AI SDK v2 that automatically traces
|
|
@@ -21508,6 +21510,25 @@ declare function wrapAnthropic<T extends object>(anthropic: T): T;
|
|
|
21508
21510
|
*/
|
|
21509
21511
|
declare function wrapClaudeAgentSDK<T extends object>(sdk: T): T;
|
|
21510
21512
|
|
|
21513
|
+
/**
|
|
21514
|
+
* Wrap a Google GenAI module (imported with `import * as googleGenAI from '@google/genai'`) to add tracing.
|
|
21515
|
+
* If Braintrust is not configured, nothing will be traced.
|
|
21516
|
+
*
|
|
21517
|
+
* @param googleGenAI The Google GenAI module
|
|
21518
|
+
* @returns The wrapped Google GenAI module
|
|
21519
|
+
*
|
|
21520
|
+
* @example
|
|
21521
|
+
* ```typescript
|
|
21522
|
+
* import * as googleGenAI from '@google/genai';
|
|
21523
|
+
* import { wrapGoogleGenAI, initLogger } from 'braintrust';
|
|
21524
|
+
*
|
|
21525
|
+
* initLogger({projectName: 'Your project' });
|
|
21526
|
+
* const { GoogleGenAI } } = wrapGoogleGenAI(googleGenAI);
|
|
21527
|
+
* const client = new GoogleGenAI({ apiKey: 'YOUR_API_KEY' });
|
|
21528
|
+
* ```
|
|
21529
|
+
*/
|
|
21530
|
+
declare function wrapGoogleGenAI<T extends Record<string, any>>(googleGenAI: T): T;
|
|
21531
|
+
|
|
21511
21532
|
interface Context {
|
|
21512
21533
|
getValue?: (key: string) => unknown;
|
|
21513
21534
|
}
|
|
@@ -21925,12 +21946,13 @@ declare const braintrust_wrapAISDK: typeof wrapAISDK;
|
|
|
21925
21946
|
declare const braintrust_wrapAISDKModel: typeof wrapAISDKModel;
|
|
21926
21947
|
declare const braintrust_wrapAnthropic: typeof wrapAnthropic;
|
|
21927
21948
|
declare const braintrust_wrapClaudeAgentSDK: typeof wrapClaudeAgentSDK;
|
|
21949
|
+
declare const braintrust_wrapGoogleGenAI: typeof wrapGoogleGenAI;
|
|
21928
21950
|
declare const braintrust_wrapMastraAgent: typeof wrapMastraAgent;
|
|
21929
21951
|
declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
|
|
21930
21952
|
declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
|
|
21931
21953
|
declare const braintrust_wrapTraced: typeof wrapTraced;
|
|
21932
21954
|
declare namespace braintrust {
|
|
21933
|
-
export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, braintrust_ContextManager as ContextManager, type braintrust_ContextParentSpanIds as ContextParentSpanIds, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_IDGenerator as IDGenerator, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_JSONAttachment as JSONAttachment, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, braintrust_OTELIDGenerator as OTELIDGenerator, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, braintrust_UUIDGenerator as UUIDGenerator, 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_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deepCopyEvent as deepCopyEvent, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getContextManager as getContextManager, braintrust_getIdGenerator as getIdGenerator, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, 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_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, 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_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapClaudeAgentSDK as wrapClaudeAgentSDK, braintrust_wrapMastraAgent as wrapMastraAgent, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
|
|
21955
|
+
export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, braintrust_ContextManager as ContextManager, type braintrust_ContextParentSpanIds as ContextParentSpanIds, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_IDGenerator as IDGenerator, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_JSONAttachment as JSONAttachment, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, braintrust_OTELIDGenerator as OTELIDGenerator, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, braintrust_UUIDGenerator as UUIDGenerator, 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_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deepCopyEvent as deepCopyEvent, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getContextManager as getContextManager, braintrust_getIdGenerator as getIdGenerator, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, 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_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, 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_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapClaudeAgentSDK as wrapClaudeAgentSDK, braintrust_wrapGoogleGenAI as wrapGoogleGenAI, braintrust_wrapMastraAgent as wrapMastraAgent, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
|
|
21934
21956
|
}
|
|
21935
21957
|
|
|
21936
21958
|
type EvaluatorManifest = Record<string, EvaluatorDef<unknown, unknown, unknown, BaseMetadata>>;
|
|
@@ -28987,4 +29009,4 @@ type EvaluatorDefinitions = z.infer<typeof evaluatorDefinitionsSchema>;
|
|
|
28987
29009
|
* @module braintrust
|
|
28988
29010
|
*/
|
|
28989
29011
|
|
|
28990
|
-
export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, IDGenerator, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapClaudeAgentSDK, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|
|
29012
|
+
export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, IDGenerator, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapClaudeAgentSDK, wrapGoogleGenAI, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|
package/dist/index.d.ts
CHANGED
|
@@ -21363,6 +21363,8 @@ interface MiddlewareConfig {
|
|
|
21363
21363
|
debug?: boolean;
|
|
21364
21364
|
/** Name identifier for the middleware instance */
|
|
21365
21365
|
name?: string;
|
|
21366
|
+
/** Span info from loadPrompt for prompt version tracking */
|
|
21367
|
+
spanInfo?: CompiledPrompt<"chat">["span_info"];
|
|
21366
21368
|
}
|
|
21367
21369
|
/**
|
|
21368
21370
|
* Creates a Braintrust middleware for AI SDK v2 that automatically traces
|
|
@@ -21508,6 +21510,25 @@ declare function wrapAnthropic<T extends object>(anthropic: T): T;
|
|
|
21508
21510
|
*/
|
|
21509
21511
|
declare function wrapClaudeAgentSDK<T extends object>(sdk: T): T;
|
|
21510
21512
|
|
|
21513
|
+
/**
|
|
21514
|
+
* Wrap a Google GenAI module (imported with `import * as googleGenAI from '@google/genai'`) to add tracing.
|
|
21515
|
+
* If Braintrust is not configured, nothing will be traced.
|
|
21516
|
+
*
|
|
21517
|
+
* @param googleGenAI The Google GenAI module
|
|
21518
|
+
* @returns The wrapped Google GenAI module
|
|
21519
|
+
*
|
|
21520
|
+
* @example
|
|
21521
|
+
* ```typescript
|
|
21522
|
+
* import * as googleGenAI from '@google/genai';
|
|
21523
|
+
* import { wrapGoogleGenAI, initLogger } from 'braintrust';
|
|
21524
|
+
*
|
|
21525
|
+
* initLogger({projectName: 'Your project' });
|
|
21526
|
+
* const { GoogleGenAI } } = wrapGoogleGenAI(googleGenAI);
|
|
21527
|
+
* const client = new GoogleGenAI({ apiKey: 'YOUR_API_KEY' });
|
|
21528
|
+
* ```
|
|
21529
|
+
*/
|
|
21530
|
+
declare function wrapGoogleGenAI<T extends Record<string, any>>(googleGenAI: T): T;
|
|
21531
|
+
|
|
21511
21532
|
interface Context {
|
|
21512
21533
|
getValue?: (key: string) => unknown;
|
|
21513
21534
|
}
|
|
@@ -21925,12 +21946,13 @@ declare const braintrust_wrapAISDK: typeof wrapAISDK;
|
|
|
21925
21946
|
declare const braintrust_wrapAISDKModel: typeof wrapAISDKModel;
|
|
21926
21947
|
declare const braintrust_wrapAnthropic: typeof wrapAnthropic;
|
|
21927
21948
|
declare const braintrust_wrapClaudeAgentSDK: typeof wrapClaudeAgentSDK;
|
|
21949
|
+
declare const braintrust_wrapGoogleGenAI: typeof wrapGoogleGenAI;
|
|
21928
21950
|
declare const braintrust_wrapMastraAgent: typeof wrapMastraAgent;
|
|
21929
21951
|
declare const braintrust_wrapOpenAI: typeof wrapOpenAI;
|
|
21930
21952
|
declare const braintrust_wrapOpenAIv4: typeof wrapOpenAIv4;
|
|
21931
21953
|
declare const braintrust_wrapTraced: typeof wrapTraced;
|
|
21932
21954
|
declare namespace braintrust {
|
|
21933
|
-
export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, braintrust_ContextManager as ContextManager, type braintrust_ContextParentSpanIds as ContextParentSpanIds, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_IDGenerator as IDGenerator, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_JSONAttachment as JSONAttachment, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, braintrust_OTELIDGenerator as OTELIDGenerator, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, braintrust_UUIDGenerator as UUIDGenerator, 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_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deepCopyEvent as deepCopyEvent, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getContextManager as getContextManager, braintrust_getIdGenerator as getIdGenerator, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, 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_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, 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_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapClaudeAgentSDK as wrapClaudeAgentSDK, braintrust_wrapMastraAgent as wrapMastraAgent, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
|
|
21955
|
+
export { braintrust_AISpanProcessor as AISpanProcessor, type braintrust_AnyDataset as AnyDataset, braintrust_Attachment as Attachment, type braintrust_AttachmentParams as AttachmentParams, type braintrust_BackgroundLoggerOpts as BackgroundLoggerOpts, braintrust_BaseAttachment as BaseAttachment, braintrust_BaseExperiment as BaseExperiment, type braintrust_BaseMetadata as BaseMetadata, braintrust_BraintrustExporter as BraintrustExporter, braintrust_BraintrustMiddleware as BraintrustMiddleware, braintrust_BraintrustSpanProcessor as BraintrustSpanProcessor, braintrust_BraintrustState as BraintrustState, braintrust_BraintrustStream as BraintrustStream, type braintrust_BraintrustStreamChunk as BraintrustStreamChunk, type braintrust_ChatPrompt as ChatPrompt, braintrust_CodeFunction as CodeFunction, type braintrust_CodeOpts as CodeOpts, braintrust_CodePrompt as CodePrompt, type braintrust_CompiledPrompt as CompiledPrompt, type braintrust_CompiledPromptParams as CompiledPromptParams, type braintrust_CompletionPrompt as CompletionPrompt, braintrust_ContextManager as ContextManager, type braintrust_ContextParentSpanIds as ContextParentSpanIds, type braintrust_CreateProjectOpts as CreateProjectOpts, type braintrust_DataSummary as DataSummary, braintrust_Dataset as Dataset, type braintrust_DatasetSummary as DatasetSummary, type braintrust_DefaultMetadataType as DefaultMetadataType, type braintrust_DefaultPromptArgs as DefaultPromptArgs, braintrust_ERR_PERMALINK as ERR_PERMALINK, type braintrust_EndSpanArgs as EndSpanArgs, braintrust_Eval as Eval, type braintrust_EvalCase as EvalCase, type braintrust_EvalHooks as EvalHooks, type braintrust_EvalResult as EvalResult, braintrust_EvalResultWithSummary as EvalResultWithSummary, type braintrust_EvalScorer as EvalScorer, type braintrust_EvalScorerArgs as EvalScorerArgs, type braintrust_EvalTask as EvalTask, type braintrust_Evaluator as Evaluator, type braintrust_EvaluatorDef as EvaluatorDef, type braintrust_EvaluatorFile as EvaluatorFile, braintrust_Experiment as Experiment, type braintrust_ExperimentSummary as ExperimentSummary, type braintrust_Exportable as Exportable, braintrust_ExternalAttachment as ExternalAttachment, type braintrust_ExternalAttachmentParams as ExternalAttachmentParams, braintrust_FailedHTTPResponse as FailedHTTPResponse, type braintrust_FullInitOptions as FullInitOptions, type braintrust_FullLoginOptions as FullLoginOptions, type braintrust_FunctionEvent as FunctionEvent, braintrust_IDGenerator as IDGenerator, braintrust_INTERNAL_BTQL_LIMIT as INTERNAL_BTQL_LIMIT, type braintrust_InitOptions as InitOptions, type braintrust_InvokeFunctionArgs as InvokeFunctionArgs, type braintrust_InvokeReturn as InvokeReturn, braintrust_JSONAttachment as JSONAttachment, braintrust_LEGACY_CACHED_HEADER as LEGACY_CACHED_HEADER, braintrust_LazyValue as LazyValue, type braintrust_LogOptions as LogOptions, braintrust_Logger as Logger, type braintrust_LoginOptions as LoginOptions, type braintrust_MetricSummary as MetricSummary, braintrust_NOOP_SPAN as NOOP_SPAN, braintrust_NOOP_SPAN_PERMALINK as NOOP_SPAN_PERMALINK, braintrust_NoopSpan as NoopSpan, braintrust_OTELIDGenerator as OTELIDGenerator, type braintrust_ObjectMetadata as ObjectMetadata, braintrust_Project as Project, braintrust_ProjectNameIdMap as ProjectNameIdMap, type braintrust_PromiseUnless as PromiseUnless, braintrust_Prompt as Prompt, braintrust_PromptBuilder as PromptBuilder, type braintrust_PromptContents as PromptContents, type braintrust_PromptDefinition as PromptDefinition, type braintrust_PromptDefinitionWithTools as PromptDefinitionWithTools, type braintrust_PromptOpts as PromptOpts, type braintrust_PromptRowWithId as PromptRowWithId, braintrust_ReadonlyAttachment as ReadonlyAttachment, braintrust_ReadonlyExperiment as ReadonlyExperiment, braintrust_Reporter as Reporter, type braintrust_ReporterBody as ReporterBody, type braintrust_ScoreSummary as ScoreSummary, braintrust_ScorerBuilder as ScorerBuilder, type braintrust_ScorerOpts as ScorerOpts, type braintrust_SerializedBraintrustState as SerializedBraintrustState, type braintrust_SetCurrentArg as SetCurrentArg, type Span$1 as Span, type braintrust_SpanContext as SpanContext, braintrust_SpanImpl as SpanImpl, type braintrust_StartSpanArgs as StartSpanArgs, braintrust_TestBackgroundLogger as TestBackgroundLogger, braintrust_ToolBuilder as ToolBuilder, braintrust_UUIDGenerator as UUIDGenerator, 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_buildLocalSummary as buildLocalSummary, braintrust_createFinalValuePassThroughStream as createFinalValuePassThroughStream, braintrust_currentExperiment as currentExperiment, braintrust_currentLogger as currentLogger, braintrust_currentSpan as currentSpan, braintrust_deepCopyEvent as deepCopyEvent, braintrust_defaultErrorScoreHandler as defaultErrorScoreHandler, braintrust_deserializePlainStringAsJSON as deserializePlainStringAsJSON, braintrust_devNullWritableStream as devNullWritableStream, braintrust_flush as flush, braintrust_getContextManager as getContextManager, braintrust_getIdGenerator as getIdGenerator, braintrust_getPromptVersions as getPromptVersions, braintrust_getSpanParentObject as getSpanParentObject, graphFramework as graph, 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_projects as projects, braintrust_promptContentsSchema as promptContentsSchema, braintrust_promptDefinitionSchema as promptDefinitionSchema, braintrust_promptDefinitionToPromptData as promptDefinitionToPromptData, braintrust_promptDefinitionWithToolsSchema as promptDefinitionWithToolsSchema, braintrust_renderMessage as renderMessage, braintrust_renderPromptParams as renderPromptParams, braintrust_reportFailures as reportFailures, braintrust_runEvaluator as runEvaluator, braintrust_setFetch as setFetch, braintrust_setMaskingFunction as setMaskingFunction, braintrust_spanComponentsToObjectId as spanComponentsToObjectId, braintrust_startSpan as startSpan, braintrust_summarize as summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, 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_wrapAISDK as wrapAISDK, braintrust_wrapAISDKModel as wrapAISDKModel, braintrust_wrapAnthropic as wrapAnthropic, braintrust_wrapClaudeAgentSDK as wrapClaudeAgentSDK, braintrust_wrapGoogleGenAI as wrapGoogleGenAI, braintrust_wrapMastraAgent as wrapMastraAgent, braintrust_wrapOpenAI as wrapOpenAI, braintrust_wrapOpenAIv4 as wrapOpenAIv4, braintrust_wrapTraced as wrapTraced };
|
|
21934
21956
|
}
|
|
21935
21957
|
|
|
21936
21958
|
type EvaluatorManifest = Record<string, EvaluatorDef<unknown, unknown, unknown, BaseMetadata>>;
|
|
@@ -28987,4 +29009,4 @@ type EvaluatorDefinitions = z.infer<typeof evaluatorDefinitionsSchema>;
|
|
|
28987
29009
|
* @module braintrust
|
|
28988
29010
|
*/
|
|
28989
29011
|
|
|
28990
|
-
export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, IDGenerator, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapClaudeAgentSDK, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|
|
29012
|
+
export { AISpanProcessor, type AnyDataset, Attachment, type AttachmentParams, AttachmentReference, type BackgroundLoggerOpts, BaseAttachment, BaseExperiment, type BaseMetadata, BraintrustExporter, BraintrustMiddleware, BraintrustSpanProcessor, BraintrustState, BraintrustStream, type BraintrustStreamChunk, type ChatPrompt, CodeFunction, type CodeOpts, CodePrompt, type CommentEvent, type CompiledPrompt, type CompiledPromptParams, type CompletionPrompt, ContextManager, type ContextParentSpanIds, type CreateProjectOpts, type DataSummary, Dataset, type DatasetRecord, type DatasetSummary, type DefaultMetadataType, type DefaultPromptArgs, ERR_PERMALINK, type EndSpanArgs, Eval, type EvalCase, type EvalHooks, type EvalParameterSerializedSchema, type EvalParameters, type EvalResult, EvalResultWithSummary, type EvalScorer, type EvalScorerArgs, type EvalTask, type Evaluator, type EvaluatorDef, type EvaluatorDefinition, type EvaluatorDefinitions, type EvaluatorFile, type EvaluatorManifest, Experiment, type ExperimentLogFullArgs, type ExperimentLogPartialArgs, type ExperimentSummary, type Exportable, ExternalAttachment, type ExternalAttachmentParams, FailedHTTPResponse, type FullInitOptions, type FullLoginOptions, type FunctionEvent, IDGenerator, INTERNAL_BTQL_LIMIT, type IdField, type InitOptions, type InputField, type InvokeFunctionArgs, type InvokeReturn, JSONAttachment, LEGACY_CACHED_HEADER, LazyValue, type LogCommentFullArgs, type LogFeedbackFullArgs, type LogOptions, Logger, type LoginOptions, type MetricSummary, NOOP_SPAN, NOOP_SPAN_PERMALINK, NoopSpan, OTELIDGenerator, type ObjectMetadata, type OtherExperimentLogFields, type ParentExperimentIds, type ParentProjectLogIds, Project, ProjectNameIdMap, type PromiseUnless, Prompt, PromptBuilder, type PromptContents, type PromptDefinition, type PromptDefinitionWithTools, type PromptOpts, type PromptRowWithId, ReadonlyAttachment, ReadonlyExperiment, Reporter, type ReporterBody, type ScoreSummary, ScorerBuilder, type ScorerOpts, type SerializedBraintrustState, type SetCurrentArg, type Span$1 as Span, type SpanContext, SpanImpl, type StartSpanArgs, TestBackgroundLogger, ToolBuilder, UUIDGenerator, type WithTransactionId, X_CACHED_HEADER, _exportsForTestingOnly, _internalGetGlobalState, _internalSetInitialState, braintrustStreamChunkSchema, buildLocalSummary, createFinalValuePassThroughStream, currentExperiment, currentLogger, currentSpan, deepCopyEvent, braintrust as default, defaultErrorScoreHandler, deserializePlainStringAsJSON, devNullWritableStream, evaluatorDefinitionSchema, evaluatorDefinitionsSchema, flush, getContextManager, getIdGenerator, getPromptVersions, getSpanParentObject, graphFramework as graph, init, initDataset, initExperiment, initFunction, initLogger, invoke, loadPrompt, log, logError, login, loginToState, newId, parseCachedHeader, permalink, projects, promptContentsSchema, promptDefinitionSchema, promptDefinitionToPromptData, promptDefinitionWithToolsSchema, renderMessage, renderPromptParams, reportFailures, runEvaluator, setFetch, setMaskingFunction, spanComponentsToObjectId, startSpan, summarize, ToolFunctionDefinition as toolFunctionDefinitionSchema, traceable, traced, updateSpan, withCurrent, withDataset, withExperiment, withLogger, withParent, wrapAISDK, wrapAISDKModel, wrapAnthropic, wrapClaudeAgentSDK, wrapGoogleGenAI, wrapMastraAgent, wrapOpenAI, wrapOpenAIv4, wrapTraced };
|