🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
import { type Prisma } from "@langfuse/shared";
type CheckHasProtectedLabelsParams = {
labelsToCheck: string[];
projectId: string;
prisma: Prisma.TransactionClient;
};
export async function checkHasProtectedLabels(
params: CheckHasProtectedLabelsParams,
): Promise<{ hasProtectedLabels: boolean; protectedLabels: string[] }> {
const { labelsToCheck, projectId, prisma } = params;
const protectedLabels = (
await prisma.promptProtectedLabels.findMany({
where: { projectId },
})
).map((l) => l.label);
const hasProtectedLabels = labelsToCheck.some((label) =>
protectedLabels.includes(label),
);
return { hasProtectedLabels, protectedLabels };
}