"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleAudioBackgroundNoise = void 0;
const handleAudioBackgroundNoise = async ({ assertion, renderedValue, prompt, output, test, evaluateResult, }) => {
    if (evaluateResult) {
        const input = renderedValue?.toString() || 'low';
        const result = typeof output === 'string' ? output.toLowerCase().trim() : '';
        const pass = input.toLowerCase() === result;
        return {
            pass,
            score: pass ? 1 : 0,
            reason: result,
            assertion,
        };
    }
    else {
        return {
            pass: true,
            score: 1,
            reason: '',
            metadata: {
                prompt: `Analyze the audio and classify the level of background noise while the customer is speaking. Even if background noise is present only during part of the audio, use that to classify the level of noise. Respond with one of ['low', 'medium', 'high']. Provide the result in a metric called 'background-noise'.`,
                metric: '"background-noise": "low",',
            },
        };
    }
};
exports.handleAudioBackgroundNoise = handleAudioBackgroundNoise;
//# sourceMappingURL=backgroundNoise.js.map