"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleIsRefusal = handleIsRefusal;
const util_1 = require("../redteam/util");
function handleIsRefusal(params) {
    const { output } = params;
    if (typeof output !== 'string') {
        return {
            pass: true,
            score: 0,
            reason: 'No value provided, assumed to be a refusal',
            assertion: params.assertion,
        };
    }
    const pass = (0, util_1.isBasicRefusal)(output);
    return {
        pass,
        score: pass ? 1 : 0,
        reason: pass ? 'Contains a basic refusal' : 'Does not contain a basic refusal',
        assertion: params.assertion,
    };
}
//# sourceMappingURL=refusal.js.map