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

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 UpdateJudgeRequestOutput =
  | JudgeClassificationOutput
  | JudgeRegressionOutput;

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

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

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

export function updateJudgeRequestOutputToJSON(
  updateJudgeRequestOutput: UpdateJudgeRequestOutput,
): string {
  return JSON.stringify(
    UpdateJudgeRequestOutput$outboundSchema.parse(updateJudgeRequestOutput),
  );
}

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

/** @internal */
export const UpdateJudgeRequest$outboundSchema: z.ZodType<
  UpdateJudgeRequest$Outbound,
  UpdateJudgeRequest
> = 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 updateJudgeRequestToJSON(
  updateJudgeRequest: UpdateJudgeRequest,
): string {
  return JSON.stringify(
    UpdateJudgeRequest$outboundSchema.parse(updateJudgeRequest),
  );
}
