/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 904f380447ed
 */

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  JudgeClassificationOutput,
  JudgeClassificationOutput$Outbound,
  JudgeClassificationOutput$outboundSchema,
} from "./judgeclassificationoutput.js";
import {
  JudgeRegressionOutput,
  JudgeRegressionOutput$Outbound,
  JudgeRegressionOutput$outboundSchema,
} from "./judgeregressionoutput.js";

export type CreateJudgeRequestOutput =
  | JudgeClassificationOutput
  | JudgeRegressionOutput;

export type CreateJudgeRequest = {
  name: string;
  description: string;
  modelName: string;
  output: JudgeClassificationOutput | JudgeRegressionOutput;
  instructions: string;
  tools: Array<string>;
};

/** @internal */
export type CreateJudgeRequestOutput$Outbound =
  | JudgeClassificationOutput$Outbound
  | JudgeRegressionOutput$Outbound;

/** @internal */
export const CreateJudgeRequestOutput$outboundSchema: z.ZodType<
  CreateJudgeRequestOutput$Outbound,
  CreateJudgeRequestOutput
> = z.union([
  JudgeClassificationOutput$outboundSchema,
  JudgeRegressionOutput$outboundSchema,
]);

export function createJudgeRequestOutputToJSON(
  createJudgeRequestOutput: CreateJudgeRequestOutput,
): string {
  return JSON.stringify(
    CreateJudgeRequestOutput$outboundSchema.parse(createJudgeRequestOutput),
  );
}

/** @internal */
export type CreateJudgeRequest$Outbound = {
  name: string;
  description: string;
  model_name: string;
  output: JudgeClassificationOutput$Outbound | JudgeRegressionOutput$Outbound;
  instructions: string;
  tools: Array<string>;
};

/** @internal */
export const CreateJudgeRequest$outboundSchema: z.ZodType<
  CreateJudgeRequest$Outbound,
  CreateJudgeRequest
> = z.object({
  name: z.string(),
  description: z.string(),
  modelName: z.string(),
  output: z.union([
    JudgeClassificationOutput$outboundSchema,
    JudgeRegressionOutput$outboundSchema,
  ]),
  instructions: z.string(),
  tools: z.array(z.string()),
}).transform((v) => {
  return remap$(v, {
    modelName: "model_name",
  });
});

export function createJudgeRequestToJSON(
  createJudgeRequest: CreateJudgeRequest,
): string {
  return JSON.stringify(
    CreateJudgeRequest$outboundSchema.parse(createJudgeRequest),
  );
}
