Generate experiences with Puck AI
Read docs
CloudAPI referencecloud-clientTypesAiGenerateFieldType

AiGenerateFieldType

Describes how Puck AI handles a user-defined field type, passed to ai.generate().

import type { AiGenerateFieldType } from "@puckeditor/cloud-client";
 
const cta: AiGenerateFieldType = {
  description: "Renders a branded call-to-action button",
  schema: { type: "object", properties: { label: { type: "string" } } },
};

Give a schema, a defaultValue, or both. For the AI plugin, use AiFieldType.

Params

ParamExampleTypeStatus
defaultValuedefaultValue: { label: "Countdown" }Any-
descriptiondescription: "Renders a branded CTA"String-
schemaschema: { type: "string" }JSON Schema-

defaultValue

The value to use when adding this field. Unlike the AI plugin’s AiFieldType, it can’t be a function.

description

A description of this field for the model.

schema

The schema Puck AI should use to generate this field.