braintrust 1.0.2 → 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 +30 -25
- package/dev/dist/index.d.ts +30 -25
- package/dev/dist/index.js +336 -325
- package/dev/dist/index.mjs +259 -248
- package/dist/browser.d.mts +2313 -322
- package/dist/browser.d.ts +2313 -322
- package/dist/browser.js +2819 -198
- package/dist/browser.mjs +2681 -60
- package/dist/cli.js +358 -160
- package/dist/index.d.mts +254 -284
- package/dist/index.d.ts +254 -284
- package/dist/index.js +484 -470
- package/dist/index.mjs +335 -321
- package/package.json +6 -2
package/dev/dist/index.d.mts
CHANGED
|
@@ -10258,6 +10258,32 @@ declare class ProjectNameIdMap {
|
|
|
10258
10258
|
resolve(project: Project): Promise<string>;
|
|
10259
10259
|
}
|
|
10260
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
|
+
|
|
10261
10287
|
declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
10262
10288
|
type: z.ZodLiteral<"prompt">;
|
|
10263
10289
|
default: z.ZodOptional<z.ZodIntersection<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
|
@@ -12128,37 +12154,16 @@ declare class EvalResultWithSummary<Input, Output, Expected, Metadata extends Ba
|
|
|
12128
12154
|
summary: ExperimentSummary;
|
|
12129
12155
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12130
12156
|
constructor(summary: ExperimentSummary, results: EvalResult<Input, Output, Expected, Metadata>[]);
|
|
12157
|
+
/**
|
|
12158
|
+
* @deprecated Use `summary` instead.
|
|
12159
|
+
*/
|
|
12131
12160
|
toString(): string;
|
|
12132
12161
|
toJSON(): {
|
|
12133
12162
|
summary: ExperimentSummary;
|
|
12134
12163
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12135
12164
|
};
|
|
12136
12165
|
}
|
|
12137
|
-
|
|
12138
|
-
verbose: boolean;
|
|
12139
|
-
jsonl: boolean;
|
|
12140
|
-
}
|
|
12141
|
-
interface ReporterBody<EvalReport> {
|
|
12142
|
-
/**
|
|
12143
|
-
* A function that takes an evaluator and its result and returns a report.
|
|
12144
|
-
*
|
|
12145
|
-
* @param evaluator
|
|
12146
|
-
* @param result
|
|
12147
|
-
* @param opts
|
|
12148
|
-
*/
|
|
12149
|
-
reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
|
|
12150
|
-
/**
|
|
12151
|
-
* A function that takes all evaluator results and returns a boolean indicating
|
|
12152
|
-
* whether the run was successful. If you return false, the `braintrust eval`
|
|
12153
|
-
* command will exit with a non-zero status code.
|
|
12154
|
-
*
|
|
12155
|
-
* @param reports
|
|
12156
|
-
*/
|
|
12157
|
-
reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
|
|
12158
|
-
}
|
|
12159
|
-
type ReporterDef<EvalReport> = {
|
|
12160
|
-
name: string;
|
|
12161
|
-
} & ReporterBody<EvalReport>;
|
|
12166
|
+
|
|
12162
12167
|
type EvaluatorDef<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = {
|
|
12163
12168
|
projectName: string;
|
|
12164
12169
|
evalName: string;
|
package/dev/dist/index.d.ts
CHANGED
|
@@ -10258,6 +10258,32 @@ declare class ProjectNameIdMap {
|
|
|
10258
10258
|
resolve(project: Project): Promise<string>;
|
|
10259
10259
|
}
|
|
10260
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
|
+
|
|
10261
10287
|
declare const evalParametersSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
10262
10288
|
type: z.ZodLiteral<"prompt">;
|
|
10263
10289
|
default: z.ZodOptional<z.ZodIntersection<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
|
@@ -12128,37 +12154,16 @@ declare class EvalResultWithSummary<Input, Output, Expected, Metadata extends Ba
|
|
|
12128
12154
|
summary: ExperimentSummary;
|
|
12129
12155
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12130
12156
|
constructor(summary: ExperimentSummary, results: EvalResult<Input, Output, Expected, Metadata>[]);
|
|
12157
|
+
/**
|
|
12158
|
+
* @deprecated Use `summary` instead.
|
|
12159
|
+
*/
|
|
12131
12160
|
toString(): string;
|
|
12132
12161
|
toJSON(): {
|
|
12133
12162
|
summary: ExperimentSummary;
|
|
12134
12163
|
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
12135
12164
|
};
|
|
12136
12165
|
}
|
|
12137
|
-
|
|
12138
|
-
verbose: boolean;
|
|
12139
|
-
jsonl: boolean;
|
|
12140
|
-
}
|
|
12141
|
-
interface ReporterBody<EvalReport> {
|
|
12142
|
-
/**
|
|
12143
|
-
* A function that takes an evaluator and its result and returns a report.
|
|
12144
|
-
*
|
|
12145
|
-
* @param evaluator
|
|
12146
|
-
* @param result
|
|
12147
|
-
* @param opts
|
|
12148
|
-
*/
|
|
12149
|
-
reportEval(evaluator: EvaluatorDef<any, any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
|
|
12150
|
-
/**
|
|
12151
|
-
* A function that takes all evaluator results and returns a boolean indicating
|
|
12152
|
-
* whether the run was successful. If you return false, the `braintrust eval`
|
|
12153
|
-
* command will exit with a non-zero status code.
|
|
12154
|
-
*
|
|
12155
|
-
* @param reports
|
|
12156
|
-
*/
|
|
12157
|
-
reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
|
|
12158
|
-
}
|
|
12159
|
-
type ReporterDef<EvalReport> = {
|
|
12160
|
-
name: string;
|
|
12161
|
-
} & ReporterBody<EvalReport>;
|
|
12166
|
+
|
|
12162
12167
|
type EvaluatorDef<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType, Parameters extends EvalParameters = EvalParameters> = {
|
|
12163
12168
|
projectName: string;
|
|
12164
12169
|
evalName: string;
|