braintrust 1.0.3-rc.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/dist/index.d.mts +32 -25
- package/dev/dist/index.d.ts +32 -25
- package/dev/dist/index.js +347 -336
- package/dev/dist/index.mjs +276 -265
- package/dist/browser.d.mts +2314 -321
- package/dist/browser.d.ts +2314 -321
- package/dist/browser.js +2842 -268
- package/dist/browser.mjs +2705 -131
- package/dist/cli.js +465 -247
- package/dist/index.d.mts +256 -284
- package/dist/index.d.ts +256 -284
- package/dist/index.js +514 -547
- package/dist/index.mjs +372 -405
- package/package.json +25 -21
- package/util/dist/index.d.mts +1 -1
- package/util/dist/index.d.ts +1 -1
- package/LICENSE +0 -201
package/dev/dist/index.d.mts
CHANGED
|
@@ -7982,6 +7982,8 @@ declare class LazyValue<T> {
|
|
|
7982
7982
|
get hasSucceeded(): boolean;
|
|
7983
7983
|
}
|
|
7984
7984
|
|
|
7985
|
+
/// <reference lib="dom" />
|
|
7986
|
+
|
|
7985
7987
|
interface ContextParentSpanIds {
|
|
7986
7988
|
rootSpanId: string;
|
|
7987
7989
|
spanParents: string[];
|
|
@@ -10256,6 +10258,32 @@ declare class ProjectNameIdMap {
|
|
|
10256
10258
|
resolve(project: Project): Promise<string>;
|
|
10257
10259
|
}
|
|
10258
10260
|
|
|
10261
|
+
interface ReporterOpts {
|
|
10262
|
+
verbose: boolean;
|
|
10263
|
+
jsonl: boolean;
|
|
10264
|
+
}
|
|
10265
|
+
interface ReporterBody<EvalReport> {
|
|
10266
|
+
/**
|
|
10267
|
+
* A function that takes an evaluator and its result and returns a report.
|
|
10268
|
+
*
|
|
10269
|
+
* @param evaluator
|
|
10270
|
+
* @param result
|
|
10271
|
+
* @param opts
|
|
10272
|
+
*/
|
|
10273
|
+
reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
|
|
10274
|
+
/**
|
|
10275
|
+
* A function that takes all evaluator results and returns a boolean indicating
|
|
10276
|
+
* whether the run was successful. If you return false, the `braintrust eval`
|
|
10277
|
+
* command will exit with a non-zero status code.
|
|
10278
|
+
*
|
|
10279
|
+
* @param reports
|
|
10280
|
+
*/
|
|
10281
|
+
reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
|
|
10282
|
+
}
|
|
10283
|
+
type ReporterDef<EvalReport> = {
|
|
10284
|
+
name: string;
|
|
10285
|
+
} & ReporterBody<EvalReport>;
|
|
10286
|
+
|
|
10259
10287
|
declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
10260
10288
|
type: z.ZodLiteral<"prompt">;
|
|
10261
10289
|
default: z.ZodOptional<z.ZodIntersection<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
|
@@ -12126,37 +12154,16 @@ declare class EvalResultWithSummary<Input, Output, Expected, Metadata extends Ba
|
|
|
12126
12154
|
summary: ExperimentSummary;
|
|
12127
12155
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12128
12156
|
constructor(summary: ExperimentSummary, results: EvalResult<Input, Output, Expected, Metadata>[]);
|
|
12157
|
+
/**
|
|
12158
|
+
* @deprecated Use `summary` instead.
|
|
12159
|
+
*/
|
|
12129
12160
|
toString(): string;
|
|
12130
12161
|
toJSON(): {
|
|
12131
12162
|
summary: ExperimentSummary;
|
|
12132
12163
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12133
12164
|
};
|
|
12134
12165
|
}
|
|
12135
|
-
|
|
12136
|
-
verbose: boolean;
|
|
12137
|
-
jsonl: boolean;
|
|
12138
|
-
}
|
|
12139
|
-
interface ReporterBody<EvalReport> {
|
|
12140
|
-
/**
|
|
12141
|
-
* A function that takes an evaluator and its result and returns a report.
|
|
12142
|
-
*
|
|
12143
|
-
* @param evaluator
|
|
12144
|
-
* @param result
|
|
12145
|
-
* @param opts
|
|
12146
|
-
*/
|
|
12147
|
-
reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
|
|
12148
|
-
/**
|
|
12149
|
-
* A function that takes all evaluator results and returns a boolean indicating
|
|
12150
|
-
* whether the run was successful. If you return false, the `braintrust eval`
|
|
12151
|
-
* command will exit with a non-zero status code.
|
|
12152
|
-
*
|
|
12153
|
-
* @param reports
|
|
12154
|
-
*/
|
|
12155
|
-
reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
|
|
12156
|
-
}
|
|
12157
|
-
type ReporterDef<EvalReport> = {
|
|
12158
|
-
name: string;
|
|
12159
|
-
} & ReporterBody<EvalReport>;
|
|
12166
|
+
|
|
12160
12167
|
type EvaluatorDef<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = {
|
|
12161
12168
|
projectName: string;
|
|
12162
12169
|
evalName: string;
|
package/dev/dist/index.d.ts
CHANGED
|
@@ -7982,6 +7982,8 @@ declare class LazyValue<T> {
|
|
|
7982
7982
|
get hasSucceeded(): boolean;
|
|
7983
7983
|
}
|
|
7984
7984
|
|
|
7985
|
+
/// <reference lib="dom" />
|
|
7986
|
+
|
|
7985
7987
|
interface ContextParentSpanIds {
|
|
7986
7988
|
rootSpanId: string;
|
|
7987
7989
|
spanParents: string[];
|
|
@@ -10256,6 +10258,32 @@ declare class ProjectNameIdMap {
|
|
|
10256
10258
|
resolve(project: Project): Promise<string>;
|
|
10257
10259
|
}
|
|
10258
10260
|
|
|
10261
|
+
interface ReporterOpts {
|
|
10262
|
+
verbose: boolean;
|
|
10263
|
+
jsonl: boolean;
|
|
10264
|
+
}
|
|
10265
|
+
interface ReporterBody<EvalReport> {
|
|
10266
|
+
/**
|
|
10267
|
+
* A function that takes an evaluator and its result and returns a report.
|
|
10268
|
+
*
|
|
10269
|
+
* @param evaluator
|
|
10270
|
+
* @param result
|
|
10271
|
+
* @param opts
|
|
10272
|
+
*/
|
|
10273
|
+
reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
|
|
10274
|
+
/**
|
|
10275
|
+
* A function that takes all evaluator results and returns a boolean indicating
|
|
10276
|
+
* whether the run was successful. If you return false, the `braintrust eval`
|
|
10277
|
+
* command will exit with a non-zero status code.
|
|
10278
|
+
*
|
|
10279
|
+
* @param reports
|
|
10280
|
+
*/
|
|
10281
|
+
reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
|
|
10282
|
+
}
|
|
10283
|
+
type ReporterDef<EvalReport> = {
|
|
10284
|
+
name: string;
|
|
10285
|
+
} & ReporterBody<EvalReport>;
|
|
10286
|
+
|
|
10259
10287
|
declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
10260
10288
|
type: z.ZodLiteral<"prompt">;
|
|
10261
10289
|
default: z.ZodOptional<z.ZodIntersection<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
|
@@ -12126,37 +12154,16 @@ declare class EvalResultWithSummary<Input, Output, Expected, Metadata extends Ba
|
|
|
12126
12154
|
summary: ExperimentSummary;
|
|
12127
12155
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12128
12156
|
constructor(summary: ExperimentSummary, results: EvalResult<Input, Output, Expected, Metadata>[]);
|
|
12157
|
+
/**
|
|
12158
|
+
* @deprecated Use `summary` instead.
|
|
12159
|
+
*/
|
|
12129
12160
|
toString(): string;
|
|
12130
12161
|
toJSON(): {
|
|
12131
12162
|
summary: ExperimentSummary;
|
|
12132
12163
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12133
12164
|
};
|
|
12134
12165
|
}
|
|
12135
|
-
|
|
12136
|
-
verbose: boolean;
|
|
12137
|
-
jsonl: boolean;
|
|
12138
|
-
}
|
|
12139
|
-
interface ReporterBody<EvalReport> {
|
|
12140
|
-
/**
|
|
12141
|
-
* A function that takes an evaluator and its result and returns a report.
|
|
12142
|
-
*
|
|
12143
|
-
* @param evaluator
|
|
12144
|
-
* @param result
|
|
12145
|
-
* @param opts
|
|
12146
|
-
*/
|
|
12147
|
-
reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
|
|
12148
|
-
/**
|
|
12149
|
-
* A function that takes all evaluator results and returns a boolean indicating
|
|
12150
|
-
* whether the run was successful. If you return false, the `braintrust eval`
|
|
12151
|
-
* command will exit with a non-zero status code.
|
|
12152
|
-
*
|
|
12153
|
-
* @param reports
|
|
12154
|
-
*/
|
|
12155
|
-
reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
|
|
12156
|
-
}
|
|
12157
|
-
type ReporterDef<EvalReport> = {
|
|
12158
|
-
name: string;
|
|
12159
|
-
} & ReporterBody<EvalReport>;
|
|
12166
|
+
|
|
12160
12167
|
type EvaluatorDef<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = {
|
|
12161
12168
|
projectName: string;
|
|
12162
12169
|
evalName: string;
|