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

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type FineTunedModelCapabilities = {
  completionChat: boolean;
  completionFim: boolean;
  functionCalling: boolean;
  fineTuning: boolean;
  classification: boolean;
};

/** @internal */
export const FineTunedModelCapabilities$inboundSchema: z.ZodType<
  FineTunedModelCapabilities,
  unknown
> = z.object({
  completion_chat: z.boolean().default(true),
  completion_fim: z.boolean().default(false),
  function_calling: z.boolean().default(false),
  fine_tuning: z.boolean().default(false),
  classification: z.boolean().default(false),
}).transform((v) => {
  return remap$(v, {
    "completion_chat": "completionChat",
    "completion_fim": "completionFim",
    "function_calling": "functionCalling",
    "fine_tuning": "fineTuning",
  });
});

export function fineTunedModelCapabilitiesFromJSON(
  jsonString: string,
): SafeParseResult<FineTunedModelCapabilities, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => FineTunedModelCapabilities$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'FineTunedModelCapabilities' from JSON`,
  );
}
