/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
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 FTModelCapabilitiesOut = {
  completionChat: boolean | undefined;
  completionFim: boolean | undefined;
  functionCalling: boolean | undefined;
  fineTuning: boolean | undefined;
  classification: boolean | undefined;
};

/** @internal */
export const FTModelCapabilitiesOut$inboundSchema: z.ZodType<
  FTModelCapabilitiesOut,
  z.ZodTypeDef,
  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 ftModelCapabilitiesOutFromJSON(
  jsonString: string,
): SafeParseResult<FTModelCapabilitiesOut, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => FTModelCapabilitiesOut$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'FTModelCapabilitiesOut' from JSON`,
  );
}
