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.
@@ -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
- interface ReporterOpts {
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;
@@ -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
- interface ReporterOpts {
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;