"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleAudioEscalation = void 0;
const handleAudioEscalation = async ({ assertion, renderedValue, prompt, output, test, evaluateResult, }) => {
    if (!renderedValue) {
        renderedValue = 'No';
    }
    if (evaluateResult) {
        const result = typeof output === 'string' ? output.toLowerCase() : '';
        const pass = renderedValue.toString().toLowerCase() === result;
        return {
            pass,
            score: pass ? 1 : 0,
            reason: result,
            assertion,
        };
    }
    else {
        return {
            pass: true,
            score: 1,
            reason: '',
            metadata: {
                prompt: `Analyze the reference transcription and audio provided to determine if an escalation occurred (i.e., the call was transferred to a higher-level agent or system). Provide the result in a metric called 'escalation' using one of ['Yes', 'No'].`,
                metric: '"escalation": "No",',
            },
        };
    }
};
exports.handleAudioEscalation = handleAudioEscalation;
//# sourceMappingURL=escalation.js.map