"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleLanguageSwitch = void 0;
const handleLanguageSwitch = async ({ assertion, renderedValue, prompt, output, test, evaluateResult, }) => {
    if (evaluateResult) {
        if (!renderedValue) {
            renderedValue = 'No';
        }
        const pass = true; // renderedValue.toString().toLowerCase() === output.toString().toLowerCase();
        return {
            pass,
            score: pass ? 1 : 0,
            reason: output.toString(),
            assertion,
        };
    }
    else {
        return {
            pass: true,
            score: 1,
            reason: '',
            metadata: {
                prompt: `Analyze the transcript that you have generated in the "transcript" field and audio to determine if the customer changed from one language to the another while speaking. Respond with "Yes" if a language switch is detected, otherwise respond with "No". Provide the result in a metric called 'language-switch'`,
                metric: '"language-switch": "Yes",',
            },
        };
    }
};
exports.handleLanguageSwitch = handleLanguageSwitch;
//# sourceMappingURL=languageSwitch.js.map