/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 6be393a3c6c3
 */
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import * as openEnums from "../../types/enums.js";
import { CompletionTrainingParameters$inboundSchema, } from "./completiontrainingparameters.js";
import { GithubRepository$inboundSchema, } from "./githubrepository.js";
import { JobMetadata$inboundSchema } from "./jobmetadata.js";
import { WandbIntegrationResult$inboundSchema, } from "./wandbintegrationresult.js";
/**
 * The current status of the fine-tuning job.
 */
export const CompletionFineTuningJobStatus = {
    Queued: "QUEUED",
    Started: "STARTED",
    Validating: "VALIDATING",
    Validated: "VALIDATED",
    Running: "RUNNING",
    FailedValidation: "FAILED_VALIDATION",
    Failed: "FAILED",
    Success: "SUCCESS",
    Cancelled: "CANCELLED",
    CancellationRequested: "CANCELLATION_REQUESTED",
};
/** @internal */
export const CompletionFineTuningJobStatus$inboundSchema = openEnums.inboundSchema(CompletionFineTuningJobStatus);
/** @internal */
export const CompletionFineTuningJobIntegration$inboundSchema = WandbIntegrationResult$inboundSchema;
export function completionFineTuningJobIntegrationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CompletionFineTuningJobIntegration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionFineTuningJobIntegration' from JSON`);
}
/** @internal */
export const CompletionFineTuningJobRepository$inboundSchema = GithubRepository$inboundSchema;
export function completionFineTuningJobRepositoryFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CompletionFineTuningJobRepository$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionFineTuningJobRepository' from JSON`);
}
/** @internal */
export const CompletionFineTuningJob$inboundSchema = z.object({
    id: z.string(),
    auto_start: z.boolean(),
    model: z.string(),
    status: CompletionFineTuningJobStatus$inboundSchema,
    created_at: z.int(),
    modified_at: z.int(),
    training_files: z.array(z.string()),
    validation_files: z.nullable(z.array(z.string())).optional(),
    object: z.literal("job").default("job"),
    fine_tuned_model: z.nullable(z.string()).optional(),
    suffix: z.nullable(z.string()).optional(),
    integrations: z.nullable(z.array(WandbIntegrationResult$inboundSchema))
        .optional(),
    trained_tokens: z.nullable(z.int()).optional(),
    metadata: z.nullable(JobMetadata$inboundSchema).optional(),
    job_type: z.literal("completion"),
    hyperparameters: CompletionTrainingParameters$inboundSchema,
    repositories: z.array(GithubRepository$inboundSchema).optional(),
}).transform((v) => {
    return remap$(v, {
        "auto_start": "autoStart",
        "created_at": "createdAt",
        "modified_at": "modifiedAt",
        "training_files": "trainingFiles",
        "validation_files": "validationFiles",
        "fine_tuned_model": "fineTunedModel",
        "trained_tokens": "trainedTokens",
        "job_type": "jobType",
    });
});
export function completionFineTuningJobFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CompletionFineTuningJob$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionFineTuningJob' from JSON`);
}
//# sourceMappingURL=completionfinetuningjob.js.map