Skip to content

Commit aad3b49

Browse files
author
Andrei Bratu
authored
Merge pull request #13 from humanloop/align-run-utility-with-python
Align run utility signature with python sdk
2 parents 20faca0 + d4d9f82 commit aad3b49

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/eval_utils/run.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ export async function runEval(
285285
// Upsert the local Evaluators; other Evaluators are just referenced by `path` or `id`
286286
let localEvaluators: [EvaluatorResponse, Function][] = [];
287287
if (evaluators) {
288-
const evaluatorsWithCallable = evaluators.filter((e) => e.callable !== null);
288+
const evaluatorsWithCallable = evaluators.filter(
289+
(e) => e.callable !== undefined,
290+
);
289291

290292
if (evaluatorsWithCallable.length > 0 && function_ == null) {
291293
throw new Error(

src/eval_utils/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ export interface Evaluator extends Identifiers {
9090
returnType?: EvaluatorReturnTypeEnum;
9191
/**The threshold to check the Evaluator against. If the aggregate value of the Evaluator is below this threshold, the check will fail.*/
9292
threshold?: number;
93-
callable: Function;
94-
argsType: EvaluatorArgumentsType;
93+
/**The function to run on the logs to produce the judgment - only required for local Evaluators.*/
94+
callable?: Function;
95+
/**The type of arguments the Evaluator expects - only required for local Evaluators.*/
96+
argsType?: EvaluatorArgumentsType;
9597
}
9698

9799
export interface TargetFreeEvaluator extends Evaluator {

0 commit comments

Comments
 (0)