import { z } from 'zod'; import { PRESENTATION_AI_ACTION_PRICING_TYPE, PRESENTATION_AI_ACTION_TYPE } from '../../constants'; export const PresentationAiActionPricingRulesSchema = z.discriminatedUnion('type', [ z.object({ type: z.literal(PRESENTATION_AI_ACTION_PRICING_TYPE.PER_CHARACTER), price: z.number(), }), z.object({ type: z.literal(PRESENTATION_AI_ACTION_PRICING_TYPE.FLAT), price: z.number(), }), ]); export type PresentationAiActionPricingRules = z.infer< typeof PresentationAiActionPricingRulesSchema >; export const PresentationAiActionSchema = z.object({ uuid: z.string(), type: z.nativeEnum(PRESENTATION_AI_ACTION_TYPE), pricingRules: PresentationAiActionPricingRulesSchema, maxPromptLength: z.number(), aiModel: z.string(), title: z.string(), icon: z.string(), order: z.number(), createdAt: z.date(), updatedAt: z.date(), }); export type PresentationAiAction = z.infer;