-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
js[patch]: simple evaluator args #1264
Changes from 5 commits
d076dce
d8cbab7
0335961
9f6771a
637fd6e
355ced5
f9d8632
f21cffc
9662c07
55a8aa6
fade984
40c12dd
973ba3d
8d3bbdc
1b62e2f
cf81392
b0bde01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,18 @@ export class DynamicRunEvaluator<Func extends (...args: any[]) => any> | |
langSmithRunAndExample: { run: Run; example: Example }; | ||
}) => { | ||
const { run, example } = input.langSmithRunAndExample; | ||
return evaluator(run, example); | ||
|
||
return evaluator( | ||
{ | ||
...run, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we just do the arity check for both of these? Is there a world where there are some crazies out there declaring evaluators like this: async (run) => {
} I would prefer the shim in both places unless we want to drop support for the two arg syntax in the long run, in which case we should deprecate the other signature: export type RunEvaluatorLike =
/** @deprecated NOTE */
| ((
run: Run,
example?: Example
) => Promise<EvaluationResult | EvaluationResults>)
/** @deprecated NOTE */
| ((run: Run, example?: Example) => EvaluationResult | EvaluationResults)
| ((args: {
run?: Run;
example?: Example;
inputs?: Record<string, any>;
outputs?: Record<string, any>;
referenceOutputs?: Record<string, any>;
}) => EvaluationResult | EvaluationResults)
| ((args: {
run?: Run;
example?: Example;
inputs?: Record<string, any>;
outputs?: Record<string, any>;
referenceOutputs?: Record<string, any>;
}) => Promise<EvaluationResult | EvaluationResults>); |
||
run, | ||
example, | ||
inputs: example?.inputs, | ||
outputs: run?.outputs, | ||
referenceOutputs: example?.outputs, | ||
}, | ||
example | ||
); | ||
}) as Func; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably also update the types for
RunEvaluatorLike
above right?