/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 73f9c10c8436
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
import { JudgeClassificationOutput$inboundSchema, } from "./judgeclassificationoutput.js";
import { JudgeRegressionOutput$inboundSchema, } from "./judgeregressionoutput.js";
/** @internal */
export const JudgeOutputUnion$inboundSchema = discriminatedUnion("type", {
    CLASSIFICATION: JudgeClassificationOutput$inboundSchema,
    REGRESSION: JudgeRegressionOutput$inboundSchema,
});
export function judgeOutputUnionFromJSON(jsonString) {
    return safeParse(jsonString, (x) => JudgeOutputUnion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JudgeOutputUnion' from JSON`);
}
/** @internal */
export const Judge$inboundSchema = z.object({
    id: z.string(),
    created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
    updated_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)),
    deleted_at: z.nullable(z.iso.datetime({ offset: true }).transform(v => new Date(v))),
    owner_id: z.string(),
    workspace_id: z.string(),
    name: z.string(),
    description: z.string(),
    model_name: z.string(),
    output: discriminatedUnion("type", {
        CLASSIFICATION: JudgeClassificationOutput$inboundSchema,
        REGRESSION: JudgeRegressionOutput$inboundSchema,
    }),
    instructions: z.string(),
    tools: z.array(z.string()),
    up_revision: z.nullable(z.string()).optional(),
    down_revision: z.nullable(z.string()).optional(),
    base_revision: z.nullable(z.string()).optional(),
}).transform((v) => {
    return remap$(v, {
        "created_at": "createdAt",
        "updated_at": "updatedAt",
        "deleted_at": "deletedAt",
        "owner_id": "ownerId",
        "workspace_id": "workspaceId",
        "model_name": "modelName",
        "up_revision": "upRevision",
        "down_revision": "downRevision",
        "base_revision": "baseRevision",
    });
});
export function judgeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => Judge$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Judge' from JSON`);
}
//# sourceMappingURL=judge.js.map