/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 25fc16962500 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { ModerationLLMAction, ModerationLLMAction$outboundSchema, } from "./moderationllmaction.js"; import { ModerationLlmv1CategoryThresholds, ModerationLlmv1CategoryThresholds$Outbound, ModerationLlmv1CategoryThresholds$outboundSchema, } from "./moderationllmv1categorythresholds.js"; export type ModerationLlmv1Config = { /** * Override model name. Should be omitted in general. */ modelName?: string | undefined; customCategoryThresholds?: | ModerationLlmv1CategoryThresholds | null | undefined; /** * If true, only evaluate categories in custom_category_thresholds; others are ignored. */ ignoreOtherCategories?: boolean | undefined; action?: ModerationLLMAction | undefined; }; /** @internal */ export type ModerationLlmv1Config$Outbound = { model_name: string; custom_category_thresholds?: | ModerationLlmv1CategoryThresholds$Outbound | null | undefined; ignore_other_categories: boolean; action?: string | undefined; }; /** @internal */ export const ModerationLlmv1Config$outboundSchema: z.ZodType< ModerationLlmv1Config$Outbound, ModerationLlmv1Config > = z.object({ modelName: z.string().default("mistral-moderation-2411"), customCategoryThresholds: z.nullable( ModerationLlmv1CategoryThresholds$outboundSchema, ).optional(), ignoreOtherCategories: z.boolean().default(false), action: ModerationLLMAction$outboundSchema.optional(), }).transform((v) => { return remap$(v, { modelName: "model_name", customCategoryThresholds: "custom_category_thresholds", ignoreOtherCategories: "ignore_other_categories", }); }); export function moderationLlmv1ConfigToJSON( moderationLlmv1Config: ModerationLlmv1Config, ): string { return JSON.stringify( ModerationLlmv1Config$outboundSchema.parse(moderationLlmv1Config), ); }