Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

719 B
Raw Blame
import { auditLog } from "@/src/features/audit-logs/auditLog";
import { BatchEvaluationService } from "@/src/features/batch-actions/server/batchEvaluationService";
import { ActionId } from "@langfuse/shared";
import { prisma } from "@langfuse/shared/src/db";
import type { ServerContext } from "../../types";

export function createMcpBatchEvaluationService(context: ServerContext) {
  return new BatchEvaluationService(prisma, (batchAction) =>
    auditLog({
      action: ActionId.ObservationBatchEvaluation,
      resourceType: "batchAction",
      resourceId: batchAction.id,
      projectId: context.projectId,
      orgId: context.orgId,
      apiKeyId: context.apiKeyId,
      after: batchAction,
    }),
  );
}