MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / startDatasetTestJobs

Function startDatasetTestJobs

app/src/server/utils/nodes/startTestJobs.ts:20–65  ·  view source on GitHub ↗
({
  datasetId,
  nodeEntryBaseQuery,
}: {
  datasetId: string;
  nodeEntryBaseQuery: NodeEntryBaseQuery;
})

Source from the content-addressed store, hash-verified

18>;
19
20export const startDatasetTestJobs = async ({
21 datasetId,
22 nodeEntryBaseQuery,
23}: {
24 datasetId: string;
25 nodeEntryBaseQuery: NodeEntryBaseQuery;
26}) => {
27 const dataset = await kysely
28 .selectFrom("Dataset as d")
29 .where("d.id", "=", datasetId)
30 .select((eb) => [
31 "d.id",
32 jsonArrayFrom(
33 eb
34 .selectFrom("DatasetEval as de")
35 .where("de.datasetId", "=", datasetId)
36 .where("de.type", "=", "HEAD_TO_HEAD")
37 .select(["de.id"]),
38 ).as("evaluations"),
39 jsonArrayFrom(
40 eb.selectFrom("FineTune as ft").where("ft.datasetId", "=", datasetId).select(["ft.id"]),
41 ).as("fineTunes"),
42 sql<ComparisonModel[]>`d."enabledComparisonModels"::text[]`.as("enabledComparisonModels"),
43 ])
44 .executeTakeFirst();
45
46 if (!dataset) return;
47
48 for (const evaluation of dataset.evaluations) {
49 await startTestJobsForEval({
50 datasetEvalId: evaluation.id,
51 nodeEntryBaseQuery,
52 });
53 }
54
55 const modelIds = dataset.fineTunes
56 .map((ft) => ft.id)
57 .concat(dataset.enabledComparisonModels ?? []);
58
59 for (const modelId of modelIds) {
60 await startTestJobsForModel({
61 modelId,
62 datasetId: dataset.id,
63 });
64 }
65};
66
67export const startTestJobsForEval = async ({
68 datasetEvalId,

Callers 3

datasets.router.tsFile · 0.90

Calls 2

startTestJobsForEvalFunction · 0.85
startTestJobsForModelFunction · 0.85

Tested by

no test coverage detected