Reevaluate all prompt stats when scenario is hidden (#32)

* Reevaluate when scenario is hidden

* Add newline
This commit is contained in:
arcticfly
2023-07-10 12:51:40 -07:00
committed by GitHub
parent ab3445eaaa
commit 187d6492f8
3 changed files with 19 additions and 4 deletions

View File

@@ -89,3 +89,11 @@ export const reevaluateEvaluation = async (evaluation: Evaluation) => {
}),
);
};
export const reevaluateAll = async (experimentId: string) => {
const evaluations = await prisma.evaluation.findMany({
where: { experimentId },
});
await Promise.all(evaluations.map(reevaluateEvaluation));
}