/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 13621d169943
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { smartUnion } from "../../types/smartUnion.js";
import { ClassifierTarget$outboundSchema, } from "./classifiertarget.js";
import { ClassifierTrainingParameters$outboundSchema, } from "./classifiertrainingparameters.js";
import { CompletionTrainingParameters$outboundSchema, } from "./completiontrainingparameters.js";
import { CreateGithubRepositoryRequest$outboundSchema, } from "./creategithubrepositoryrequest.js";
import { FineTuneableModelType$outboundSchema, } from "./finetuneablemodeltype.js";
import { TrainingFile$outboundSchema, } from "./trainingfile.js";
import { WandbIntegration$outboundSchema, } from "./wandbintegration.js";
/** @internal */
export const CreateFineTuningJobRequestIntegration$outboundSchema = WandbIntegration$outboundSchema;
export function createFineTuningJobRequestIntegrationToJSON(createFineTuningJobRequestIntegration) {
    return JSON.stringify(CreateFineTuningJobRequestIntegration$outboundSchema.parse(createFineTuningJobRequestIntegration));
}
/** @internal */
export const Hyperparameters$outboundSchema = smartUnion([
    CompletionTrainingParameters$outboundSchema,
    ClassifierTrainingParameters$outboundSchema,
]);
export function hyperparametersToJSON(hyperparameters) {
    return JSON.stringify(Hyperparameters$outboundSchema.parse(hyperparameters));
}
/** @internal */
export const CreateFineTuningJobRequestRepository$outboundSchema = CreateGithubRepositoryRequest$outboundSchema;
export function createFineTuningJobRequestRepositoryToJSON(createFineTuningJobRequestRepository) {
    return JSON.stringify(CreateFineTuningJobRequestRepository$outboundSchema.parse(createFineTuningJobRequestRepository));
}
/** @internal */
export const CreateFineTuningJobRequest$outboundSchema = z.object({
    model: z.string(),
    trainingFiles: z.array(TrainingFile$outboundSchema).optional(),
    validationFiles: z.nullable(z.array(z.string())).optional(),
    suffix: z.nullable(z.string()).optional(),
    integrations: z.nullable(z.array(WandbIntegration$outboundSchema)).optional(),
    autoStart: z.boolean().optional(),
    invalidSampleSkipPercentage: z.number().default(0),
    jobType: z.nullable(FineTuneableModelType$outboundSchema).optional(),
    hyperparameters: smartUnion([
        CompletionTrainingParameters$outboundSchema,
        ClassifierTrainingParameters$outboundSchema,
    ]),
    repositories: z.nullable(z.array(CreateGithubRepositoryRequest$outboundSchema)).optional(),
    classifierTargets: z.nullable(z.array(ClassifierTarget$outboundSchema))
        .optional(),
}).transform((v) => {
    return remap$(v, {
        trainingFiles: "training_files",
        validationFiles: "validation_files",
        autoStart: "auto_start",
        invalidSampleSkipPercentage: "invalid_sample_skip_percentage",
        jobType: "job_type",
        classifierTargets: "classifier_targets",
    });
});
export function createFineTuningJobRequestToJSON(createFineTuningJobRequest) {
    return JSON.stringify(CreateFineTuningJobRequest$outboundSchema.parse(createFineTuningJobRequest));
}
//# sourceMappingURL=createfinetuningjobrequest.js.map