"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateEvalResponseBody$inboundSchema = exports.UpdateEvalRequest$outboundSchema = exports.UpdateEvalRequestBody$outboundSchema = exports.VersionIncrement$outboundSchema = exports.Jury$outboundSchema = exports.TieValue$outboundSchema = exports.ReplacementJudges$outboundSchema = exports.UpdateEvalFallbacks$outboundSchema = exports.UpdateEvalRetry$outboundSchema = exports.Judges$outboundSchema = exports.Fallbacks$outboundSchema = exports.Retry$outboundSchema = exports.Mode$outboundSchema = exports.CategoricalLabels$outboundSchema = exports.VersionIncrement = exports.TieValue = exports.Mode = void 0;
exports.categoricalLabelsToJSON = categoricalLabelsToJSON;
exports.retryToJSON = retryToJSON;
exports.fallbacksToJSON = fallbacksToJSON;
exports.judgesToJSON = judgesToJSON;
exports.updateEvalRetryToJSON = updateEvalRetryToJSON;
exports.updateEvalFallbacksToJSON = updateEvalFallbacksToJSON;
exports.replacementJudgesToJSON = replacementJudgesToJSON;
exports.juryToJSON = juryToJSON;
exports.updateEvalRequestBodyToJSON = updateEvalRequestBodyToJSON;
exports.updateEvalRequestToJSON = updateEvalRequestToJSON;
exports.updateEvalResponseBodyFromJSON = updateEvalResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const components = __importStar(require("../components/index.js"));
exports.Mode = {
    Single: "single",
    Jury: "jury",
};
exports.TieValue = {
    Tie: "Tie",
};
exports.VersionIncrement = {
    Major: "major",
    Minor: "minor",
    Patch: "patch",
};
/** @internal */
exports.CategoricalLabels$outboundSchema = z.object({
    value: z.string(),
    description: z.string().optional(),
});
function categoricalLabelsToJSON(categoricalLabels) {
    return JSON.stringify(exports.CategoricalLabels$outboundSchema.parse(categoricalLabels));
}
/** @internal */
exports.Mode$outboundSchema = z.nativeEnum(exports.Mode);
/** @internal */
exports.Retry$outboundSchema = z.object({
    count: z.number().int().default(2),
    onCodes: z.array(z.number().int()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function retryToJSON(retry) {
    return JSON.stringify(exports.Retry$outboundSchema.parse(retry));
}
/** @internal */
exports.Fallbacks$outboundSchema = z.object({
    model: z.string(),
});
function fallbacksToJSON(fallbacks) {
    return JSON.stringify(exports.Fallbacks$outboundSchema.parse(fallbacks));
}
/** @internal */
exports.Judges$outboundSchema = z.object({
    model: z.string(),
    retry: z.lazy(() => exports.Retry$outboundSchema).optional(),
    fallbacks: z.array(z.lazy(() => exports.Fallbacks$outboundSchema)).optional(),
});
function judgesToJSON(judges) {
    return JSON.stringify(exports.Judges$outboundSchema.parse(judges));
}
/** @internal */
exports.UpdateEvalRetry$outboundSchema = z.object({
    count: z.number().int().default(2),
    onCodes: z.array(z.number().int()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        onCodes: "on_codes",
    });
});
function updateEvalRetryToJSON(updateEvalRetry) {
    return JSON.stringify(exports.UpdateEvalRetry$outboundSchema.parse(updateEvalRetry));
}
/** @internal */
exports.UpdateEvalFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function updateEvalFallbacksToJSON(updateEvalFallbacks) {
    return JSON.stringify(exports.UpdateEvalFallbacks$outboundSchema.parse(updateEvalFallbacks));
}
/** @internal */
exports.ReplacementJudges$outboundSchema = z.object({
    model: z.string(),
    retry: z.lazy(() => exports.UpdateEvalRetry$outboundSchema).optional(),
    fallbacks: z.array(z.lazy(() => exports.UpdateEvalFallbacks$outboundSchema))
        .optional(),
});
function replacementJudgesToJSON(replacementJudges) {
    return JSON.stringify(exports.ReplacementJudges$outboundSchema.parse(replacementJudges));
}
/** @internal */
exports.TieValue$outboundSchema = z
    .nativeEnum(exports.TieValue);
/** @internal */
exports.Jury$outboundSchema = z.object({
    judges: z.array(z.lazy(() => exports.Judges$outboundSchema)),
    replacementJudges: z.array(z.lazy(() => exports.ReplacementJudges$outboundSchema))
        .optional(),
    minSuccessfulJudges: z.number().int().default(2),
    tieValue: exports.TieValue$outboundSchema.default("Tie"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        replacementJudges: "replacement_judges",
        minSuccessfulJudges: "min_successful_judges",
        tieValue: "tie_value",
    });
});
function juryToJSON(jury) {
    return JSON.stringify(exports.Jury$outboundSchema.parse(jury));
}
/** @internal */
exports.VersionIncrement$outboundSchema = z.nativeEnum(exports.VersionIncrement);
/** @internal */
exports.UpdateEvalRequestBody$outboundSchema = z.object({
    type: z.string().optional(),
    path: z.string().optional(),
    key: z.string().optional(),
    description: z.string().optional(),
    prompt: z.string().optional(),
    outputType: z.string().optional(),
    categories: z.nullable(z.array(z.string())).optional(),
    categoricalLabels: z.nullable(z.array(z.lazy(() => exports.CategoricalLabels$outboundSchema))).optional(),
    repetitions: z.number().optional(),
    mode: exports.Mode$outboundSchema.optional(),
    model: z.string().optional(),
    jury: z.lazy(() => exports.Jury$outboundSchema).optional(),
    schema: z.string().optional(),
    url: z.string().optional(),
    method: z.string().optional(),
    headers: z.record(z.string()).optional(),
    payload: z.record(z.any()).optional(),
    code: z.string().optional(),
    guardrailConfig: z.any().optional(),
    versionIncrement: exports.VersionIncrement$outboundSchema.optional(),
    versionDescription: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        outputType: "output_type",
        categoricalLabels: "categorical_labels",
        guardrailConfig: "guardrail_config",
    });
});
function updateEvalRequestBodyToJSON(updateEvalRequestBody) {
    return JSON.stringify(exports.UpdateEvalRequestBody$outboundSchema.parse(updateEvalRequestBody));
}
/** @internal */
exports.UpdateEvalRequest$outboundSchema = z.object({
    id: z.string(),
    requestBody: z.lazy(() => exports.UpdateEvalRequestBody$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        requestBody: "RequestBody",
    });
});
function updateEvalRequestToJSON(updateEvalRequest) {
    return JSON.stringify(exports.UpdateEvalRequest$outboundSchema.parse(updateEvalRequest));
}
/** @internal */
exports.UpdateEvalResponseBody$inboundSchema = z.union([
    components.EvaluatorResponseLlm$inboundSchema,
    components.EvaluatorResponseJsonSchema$inboundSchema,
    components.EvaluatorResponseHttp$inboundSchema,
    components.EvaluatorResponsePython$inboundSchema,
    components.EvaluatorResponseFunction$inboundSchema,
    components.EvaluatorResponseRagas$inboundSchema,
    components.EvaluatorResponseTypescript$inboundSchema,
]);
function updateEvalResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateEvalResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateEvalResponseBody' from JSON`);
}
//# sourceMappingURL=updateeval.js.map