"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.CreateEvalResponseBody$inboundSchema = exports.CreateEvalRequestBody$outboundSchema = exports.Llm$outboundSchema = exports.Llm1$outboundSchema = exports.CreateEvalLLMCategoricalLabels$outboundSchema = exports.CreateEvalLLMType$outboundSchema = exports.CreateEvalLLMOutputType$outboundSchema = exports.Llm2$outboundSchema = exports.LLMJury$outboundSchema = exports.LLMTieValue$outboundSchema = exports.LLMReplacementJudges$outboundSchema = exports.LLMFallbacks$outboundSchema = exports.LLMRetry$outboundSchema = exports.LLMJudges$outboundSchema = exports.CreateEvalLLMFallbacks$outboundSchema = exports.CreateEvalLLMRetry$outboundSchema = exports.LLMCategoricalLabels$outboundSchema = exports.LLMType$outboundSchema = exports.LLMOutputType$outboundSchema = exports.Python$outboundSchema = exports.RequestBodyType$outboundSchema = exports.OutputType$outboundSchema = exports.CreateEvalLLMType = exports.CreateEvalLLMOutputType = exports.LLMTieValue = exports.LLMType = exports.LLMOutputType = exports.RequestBodyType = exports.OutputType = void 0;
exports.pythonToJSON = pythonToJSON;
exports.llmCategoricalLabelsToJSON = llmCategoricalLabelsToJSON;
exports.createEvalLLMRetryToJSON = createEvalLLMRetryToJSON;
exports.createEvalLLMFallbacksToJSON = createEvalLLMFallbacksToJSON;
exports.llmJudgesToJSON = llmJudgesToJSON;
exports.llmRetryToJSON = llmRetryToJSON;
exports.llmFallbacksToJSON = llmFallbacksToJSON;
exports.llmReplacementJudgesToJSON = llmReplacementJudgesToJSON;
exports.llmJuryToJSON = llmJuryToJSON;
exports.llm2ToJSON = llm2ToJSON;
exports.createEvalLLMCategoricalLabelsToJSON = createEvalLLMCategoricalLabelsToJSON;
exports.llm1ToJSON = llm1ToJSON;
exports.llmToJSON = llmToJSON;
exports.createEvalRequestBodyToJSON = createEvalRequestBodyToJSON;
exports.createEvalResponseBodyFromJSON = createEvalResponseBodyFromJSON;
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.OutputType = {
    Boolean: "boolean",
    Number: "number",
};
exports.RequestBodyType = {
    PythonEval: "python_eval",
};
/**
 * The type of output expected from the evaluator
 */
exports.LLMOutputType = {
    Boolean: "boolean",
    Categorical: "categorical",
    Number: "number",
    String: "string",
};
exports.LLMType = {
    LlmEval: "llm_eval",
};
exports.LLMTieValue = {
    Tie: "Tie",
};
/**
 * The type of output expected from the evaluator
 */
exports.CreateEvalLLMOutputType = {
    Boolean: "boolean",
    Categorical: "categorical",
    Number: "number",
    String: "string",
};
exports.CreateEvalLLMType = {
    LlmEval: "llm_eval",
};
/** @internal */
exports.OutputType$outboundSchema = z
    .nativeEnum(exports.OutputType);
/** @internal */
exports.RequestBodyType$outboundSchema = z.nativeEnum(exports.RequestBodyType);
/** @internal */
exports.Python$outboundSchema = z.object({
    guardrailConfig: z.any().optional(),
    outputType: exports.OutputType$outboundSchema.optional(),
    code: z.string(),
    type: exports.RequestBodyType$outboundSchema,
    path: z.string(),
    description: z.string().default(""),
    key: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        guardrailConfig: "guardrail_config",
        outputType: "output_type",
    });
});
function pythonToJSON(python) {
    return JSON.stringify(exports.Python$outboundSchema.parse(python));
}
/** @internal */
exports.LLMOutputType$outboundSchema = z.nativeEnum(exports.LLMOutputType);
/** @internal */
exports.LLMType$outboundSchema = z
    .nativeEnum(exports.LLMType);
/** @internal */
exports.LLMCategoricalLabels$outboundSchema = z.object({
    value: z.string(),
    description: z.string().optional(),
});
function llmCategoricalLabelsToJSON(llmCategoricalLabels) {
    return JSON.stringify(exports.LLMCategoricalLabels$outboundSchema.parse(llmCategoricalLabels));
}
/** @internal */
exports.CreateEvalLLMRetry$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 createEvalLLMRetryToJSON(createEvalLLMRetry) {
    return JSON.stringify(exports.CreateEvalLLMRetry$outboundSchema.parse(createEvalLLMRetry));
}
/** @internal */
exports.CreateEvalLLMFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function createEvalLLMFallbacksToJSON(createEvalLLMFallbacks) {
    return JSON.stringify(exports.CreateEvalLLMFallbacks$outboundSchema.parse(createEvalLLMFallbacks));
}
/** @internal */
exports.LLMJudges$outboundSchema = z.object({
    model: z.string(),
    retry: z.lazy(() => exports.CreateEvalLLMRetry$outboundSchema).optional(),
    fallbacks: z.array(z.lazy(() => exports.CreateEvalLLMFallbacks$outboundSchema))
        .optional(),
});
function llmJudgesToJSON(llmJudges) {
    return JSON.stringify(exports.LLMJudges$outboundSchema.parse(llmJudges));
}
/** @internal */
exports.LLMRetry$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 llmRetryToJSON(llmRetry) {
    return JSON.stringify(exports.LLMRetry$outboundSchema.parse(llmRetry));
}
/** @internal */
exports.LLMFallbacks$outboundSchema = z.object({
    model: z.string(),
});
function llmFallbacksToJSON(llmFallbacks) {
    return JSON.stringify(exports.LLMFallbacks$outboundSchema.parse(llmFallbacks));
}
/** @internal */
exports.LLMReplacementJudges$outboundSchema = z.object({
    model: z.string(),
    retry: z.lazy(() => exports.LLMRetry$outboundSchema).optional(),
    fallbacks: z.array(z.lazy(() => exports.LLMFallbacks$outboundSchema)).optional(),
});
function llmReplacementJudgesToJSON(llmReplacementJudges) {
    return JSON.stringify(exports.LLMReplacementJudges$outboundSchema.parse(llmReplacementJudges));
}
/** @internal */
exports.LLMTieValue$outboundSchema = z
    .nativeEnum(exports.LLMTieValue);
/** @internal */
exports.LLMJury$outboundSchema = z.object({
    judges: z.array(z.lazy(() => exports.LLMJudges$outboundSchema)),
    replacementJudges: z.array(z.lazy(() => exports.LLMReplacementJudges$outboundSchema))
        .optional(),
    minSuccessfulJudges: z.number().int().default(2),
    tieValue: exports.LLMTieValue$outboundSchema.default("Tie"),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        replacementJudges: "replacement_judges",
        minSuccessfulJudges: "min_successful_judges",
        tieValue: "tie_value",
    });
});
function llmJuryToJSON(llmJury) {
    return JSON.stringify(exports.LLMJury$outboundSchema.parse(llmJury));
}
/** @internal */
exports.Llm2$outboundSchema = z.object({
    guardrailConfig: z.any().optional(),
    outputType: exports.LLMOutputType$outboundSchema.optional(),
    type: exports.LLMType$outboundSchema,
    repetitions: z.nullable(z.number().int()).optional(),
    prompt: z.string(),
    categories: z.nullable(z.array(z.string())).optional(),
    categoricalLabels: z.nullable(z.array(z.lazy(() => exports.LLMCategoricalLabels$outboundSchema))).optional(),
    datasetId: z.string().optional(),
    path: z.string(),
    description: z.string().default(""),
    key: z.string(),
    mode: z.literal("jury"),
    jury: z.lazy(() => exports.LLMJury$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        guardrailConfig: "guardrail_config",
        outputType: "output_type",
        categoricalLabels: "categorical_labels",
        datasetId: "dataset_id",
    });
});
function llm2ToJSON(llm2) {
    return JSON.stringify(exports.Llm2$outboundSchema.parse(llm2));
}
/** @internal */
exports.CreateEvalLLMOutputType$outboundSchema = z.nativeEnum(exports.CreateEvalLLMOutputType);
/** @internal */
exports.CreateEvalLLMType$outboundSchema = z.nativeEnum(exports.CreateEvalLLMType);
/** @internal */
exports.CreateEvalLLMCategoricalLabels$outboundSchema = z.object({
    value: z.string(),
    description: z.string().optional(),
});
function createEvalLLMCategoricalLabelsToJSON(createEvalLLMCategoricalLabels) {
    return JSON.stringify(exports.CreateEvalLLMCategoricalLabels$outboundSchema.parse(createEvalLLMCategoricalLabels));
}
/** @internal */
exports.Llm1$outboundSchema = z.object({
    guardrailConfig: z.any().optional(),
    outputType: exports.CreateEvalLLMOutputType$outboundSchema.optional(),
    type: exports.CreateEvalLLMType$outboundSchema,
    repetitions: z.nullable(z.number().int()).optional(),
    prompt: z.string(),
    categories: z.nullable(z.array(z.string())).optional(),
    categoricalLabels: z.nullable(z.array(z.lazy(() => exports.CreateEvalLLMCategoricalLabels$outboundSchema))).optional(),
    datasetId: z.string().optional(),
    path: z.string(),
    description: z.string().default(""),
    key: z.string(),
    mode: z.literal("single"),
    model: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        guardrailConfig: "guardrail_config",
        outputType: "output_type",
        categoricalLabels: "categorical_labels",
        datasetId: "dataset_id",
    });
});
function llm1ToJSON(llm1) {
    return JSON.stringify(exports.Llm1$outboundSchema.parse(llm1));
}
/** @internal */
exports.Llm$outboundSchema = z
    .union([
    z.lazy(() => exports.Llm1$outboundSchema),
    z.lazy(() => exports.Llm2$outboundSchema),
]);
function llmToJSON(llm) {
    return JSON.stringify(exports.Llm$outboundSchema.parse(llm));
}
/** @internal */
exports.CreateEvalRequestBody$outboundSchema = z.union([
    z.lazy(() => exports.Python$outboundSchema),
    z.union([
        z.lazy(() => exports.Llm1$outboundSchema),
        z.lazy(() => exports.Llm2$outboundSchema),
    ]),
]);
function createEvalRequestBodyToJSON(createEvalRequestBody) {
    return JSON.stringify(exports.CreateEvalRequestBody$outboundSchema.parse(createEvalRequestBody));
}
/** @internal */
exports.CreateEvalResponseBody$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 createEvalResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateEvalResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEvalResponseBody' from JSON`);
}
//# sourceMappingURL=createeval.js.map