"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleVideoGEval = void 0;
const invariant_1 = __importDefault(require("../../util/invariant"));
const matchers_1 = require("../../matchers");
const utils_1 = require("./utils");
const handleVideoGEval = async ({ assertion, prompt, outputString, outputVideo, renderedValue, test, workspaceId, }) => {
    (0, invariant_1.default)(typeof renderedValue === 'string' || Array.isArray(renderedValue), 'G-Eval assertion type must have a string or array of strings value');
    const threshold = assertion.threshold ?? 0.7;
    let videoUrl = outputVideo?.url;
    if (!videoUrl && outputString) {
        videoUrl = (0, utils_1.getVideoUrl)(outputString);
    }
    const resp = await (0, matchers_1.matchesMultimodalGEval)(renderedValue, prompt || '', videoUrl || '', threshold, 'video', test.options, workspaceId);
    return {
        assertion,
        ...resp,
    };
};
exports.handleVideoGEval = handleVideoGEval;
//# sourceMappingURL=gEval.js.map