mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
29 lines
808 B
TypeScript
29 lines
808 B
TypeScript
"use server"
|
|
|
|
import { getModelId, rooCodeSettingsSchema } from "@roo-code/types"
|
|
import { getRuns, getLanguageScores } from "@roo-code/evals"
|
|
|
|
import { formatScore } from "@/lib"
|
|
|
|
export async function getEvalRuns() {
|
|
const languageScores = await getLanguageScores()
|
|
|
|
const runs = (await getRuns())
|
|
.filter((run) => !!run.taskMetrics)
|
|
.filter(({ settings }) => rooCodeSettingsSchema.safeParse(settings).success)
|
|
.sort((a, b) => b.passed - a.passed)
|
|
.map((run) => {
|
|
const settings = rooCodeSettingsSchema.parse(run.settings)
|
|
|
|
return {
|
|
...run,
|
|
label: run.description || run.model,
|
|
score: formatScore(run.passed / (run.passed + run.failed)),
|
|
languageScores: languageScores[run.id],
|
|
taskMetrics: run.taskMetrics!,
|
|
modelId: getModelId(settings),
|
|
}
|
|
})
|
|
|
|
return runs
|
|
}
|