payload-custom-plugin v1.1.33
payload-custom-plugin
Install the following package to generate description through AI
npm i payload-custom-plugin
In Collection file import the ContentConfig from payload-custom-plugin
import { ContentConfig } from 'payload-custom-plugin';
instead of "import { CollectionConfig } from 'payload/types';"
Add OPENAI_API_KEY in .env file
OPENAI_API_KEY="Your OPEN API KEY"
Set autoDescription in constant in collection
autoDescription: true,
For which field want to generate description through AI provide name as "Title"fieldname"" and where these description needs to show set the name of field as "Description"fieldname"" e.g. " { name: 'TitleTagline', type: 'text', label: 'Any Label', required: true, }, { name: 'Description_Tagline', type: 'textarea', label: 'Any label', admin: { condition: (, siblingData) => !!siblingData.Description, }, }, "
For multiple fields generate the description according to Field value, give the field names after "Title" and "Description" e.g. " { name: 'TitleBulletedPoints', type: 'text', label: 'Any label', required: true, }, { name: 'Description_BulletedPoints', type: 'textarea', label: 'Any label', admin: { condition: (, siblingData) => !!siblingData.Description, }, }, "
In payload.config.ts file import ContentGenerator from payload-custom-plugin
import ContentGenerator from 'payload-custom-plugin';
Define the collection in plugin instead of collections
plugins: [
ContentGenerator(collection_name),
],
run npm dev
While generating the content in payload dashboard use following indentations, e.g If you want to generate tagline for AWS use title field like "tagline : AWS"
If you want to generate description for AWS use title field like "description : AWS", you can provide word limit also before ":" like "100 word description : AWS"
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago