"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runGuardrail = runGuardrail;
exports.runGuardrails = runGuardrails;
const content_safety_1 = require("./content-safety");
/**
 * Guardrail handlers map
 * Maps guardrail types to their handler functions
 */
const guardrailHandlers = {
    'content-safety': content_safety_1.handleContentSafety,
};
/**
 * Run a guardrail check
 * @param guardrailType - The type of guardrail to run
 * @param params - Guardrail parameters containing the output to check
 * @returns Grading result indicating pass/fail status
 */
async function runGuardrail({ guardrailType, assertion, outputString, prompt, config, context, }) {
    const handler = guardrailHandlers[guardrailType];
    if (!handler) {
        throw new Error(`Unknown guardrail type: ${guardrailType}`);
    }
    return handler({
        assertion,
        outputString,
        prompt,
        config,
        context,
    });
}
/**
 * Run multiple guardrails on the same output
 * @param guardrailTypes - Array of guardrail types to run
 * @param params - Guardrail parameters containing the output to check
 * @returns Array of grading results for each guardrail
 */
async function runGuardrails({ guardrailTypes, assertion, outputString, prompt, config, context, }) {
    const results = await Promise.all(guardrailTypes.map((type) => runGuardrail({
        guardrailType: type,
        assertion,
        outputString,
        prompt,
        config,
        context,
    })));
    return results;
}
//# sourceMappingURL=index.js.map