"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleNoAgentResponse = void 0;
const handleNoAgentResponse = 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 transcript that you have generated in the "transcript" field and audio to identify if the AI Bot agent failed to provide a response to the a customer query or question. Examples of no agent response are: a) Customer asked a question, but the agent did not respond. Output a value as either "Yes" if it failed to provide a response, otherwise "No". Provide the result in a metric called 'no-agent-response'.`,
                metric: '"no-agent-response": "Yes",',
            },
        };
    }
};
exports.handleNoAgentResponse = handleNoAgentResponse;
//# sourceMappingURL=noAgentResponse.js.map