MCPcopy
hub / github.com/OpenPipe/OpenPipe / getStringsToPrune

Function getStringsToPrune

app/src/utils/pruningRules.ts:15–24  ·  view source on GitHub ↗
(modelId: string)

Source from the content-addressed store, hash-verified

13
14// If model is comparison model, this will return an empty array
15export const getStringsToPrune = async (modelId: string) => {
16 if (isComparisonModel(modelId)) return [];
17
18 const pruningRules = await prisma.pruningRule.findMany({
19 where: { fineTuneId: modelId },
20 select: { textToMatch: true },
21 orderBy: [{ createdAt: "asc" }, { id: "asc" }],
22 });
23 return pruningRules.map((rule) => rule.textToMatch);
24};
25
26export const pruneInputMessages = (
27 messages: ChatCompletionMessageParam[],

Callers 4

getCompletionFunction · 0.90
trainOpenaiFineTuneFunction · 0.90
trainModalFineTuneFunction · 0.90

Calls 1

isComparisonModelFunction · 0.90

Tested by

no test coverage detected