You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/components/modai/README.md
+15-13Lines changed: 15 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# modAI
2
-
A proof of concept Extras to auto-create SEO-related content including page titles, meta titles, meta descriptions, page summaries, and images/alt text that can be used for Open Graph sharing images or hero sections of pages.
2
+
A proof of concept Extra to auto-create SEO-related content including page titles, meta titles, meta descriptions, page summaries, and images/alt text that can be used for Open Graph sharing images or hero sections of pages.
3
3
4
-
The Plugin adds a magician’s wand emoji symbol (🪄) next to various field labels in the back-end Manager. When clicked, it should:
4
+
The Plugin adds a sparkle (✦) button next to field or labels in the back-end Manager. When clicked, it:
5
5
6
6
- use prompts based on the type of content being created,
7
7
- use the ChatGPT API to create said content, and
8
-
- dumps the result into the appropriate field.
8
+
- dumps the result into the appropriate field or a textarea that you can copy/paste from (e.g., for the Content field).
9
9
10
10
## Requirements
11
11
@@ -27,26 +27,28 @@ The base prompt is appended to every prompt you generate. It can be considered s
27
27
28
28
**Note:** modAI also works with SEO Suite, which uses the longtitle and description fields (see below). It also supports image+ for things like Open Graph sharing preview images, hero section images, etc.
29
29
30
-
The `modai.prompt.base` can be used for **{INSERT DESCRIPTION HERE}**
30
+
The `modai.prompt.base` can be thought of as the equivalent to a light version of ChatGPT’s custom instructions: it appends the base prompt to ever other prompt for your site.
31
31
32
-
If you wish to override a model or model configuration for a specific field, or to attach to additional fields, you do so by creating a system setting in the format of `modai.prompt.{field}`, where field is any of the built in fields in MODX. You can also attach modAI to Template Variables (TVs) with input options of text, textarea or image TVs. It will always attach to Image+ TVs, with support for the alt attribute generation. **[TODO: confirm TVs]**
32
+
If you wish to override a model or model configuration for a specific field, or to attach to additional fields, you do so by creating a system setting in the format of `modai.prompt.{field}.{setting}` substituting for the relevant `{field}` and `{setting}` as appropriate.
33
+
34
+
You can attach modAI to text, textarea or image Template Variables (TVs) using similar settings to the built in fields: `modai.prompt.{tv-name}.{setting}` (setting is optional). It will always attach to Image+ TVs, with support for the alt attribute generation using the vision models to describe the images for you.
33
35
34
36
## Usage
35
37
36
-
Wherever you see a 🪄, you can click it to call the chatGPT api to create content in those fileds. It will automatically attach that behavior to several fields defined below. You can delete the prompt settings below to remove modAI from generative AI content creation:
38
+
Wherever you see a field or a label with a “sparkle” button next to it (✦), click it to call the chatGPT api to create content in those fileds based on the prompts stored in the system settings. It will automatically attach that behavior to several fields defined below. Delete the prompt settings below will remove modAI from generative AI content creation for those fields:
37
39
38
-
- pagetitle – sometimes used for an H1 tag (~60 characters)
39
-
- longtitle – often used for the SEO Meta Title (should be ~70 characters)
40
-
- description – often used for the SEO Meta Description (should be ~155 characters)
41
-
- introtext – aka Summary, this is used to create a brief summary of the page content field and used to generate images
42
-
- image+ Image fields – it will use the introtext/summary as a default prompt which can be overwritten before requesting an image generation. It also uses the vision API to create 120 character alt tag descriptions if enabled for your Image+ TVs.
40
+
-**pagetitle** – sometimes used for an H1 tag (~60 characters)
41
+
-**longtitle** – often used for the SEO Meta Title (should be ~70 characters)
42
+
-**description** – often used for the SEO Meta Description (should be ~155 characters)
43
+
-**introtext** – aka Summary, this is used to create a brief summary of the page content field and used to generate images
44
+
-**image+ TVs** – it will use the introtext/summary as a default prompt which can be overwritten before requesting an image generation. It also uses the vision API to create 120 character alt tag descriptions if enabled for your Image+ TVs.
43
45
44
-
If you’re not happy with what it generates, click the icon again to generate another variation. You can then use the small arrows to go between the options. When you save, it keeps the option shown and discards the rest.
46
+
If you’re not happy with what it generates, click the sparkle button again to generate another variation. You can then use the small arrows to go between the options. When you save, it keeps the option shown and discards the rest.
45
47
46
48
For details on current models supported, consult the documentation at https://platform.openai.com/docs/models, https://platform.openai.com/docs/guides/text-generation, https://platform.openai.com/docs/guides/vision, and https://platform.openai.com/docs/guides/images.
47
49
48
50
## Costs
49
51
50
52
OpenAI API credits must be purchased for this Extra to work. You can find costs for the various models at https://openai.com/api/pricing/.
51
53
52
-
To learn more about maanging cost, make sure to use the most optimal models for the type of content you expect your prompts to generate. For example, [1000 tokes is roughly equal to 750 words](https://platform.openai.com/docs/guides/production-best-practices#text-generation); make sure the [model you choose](https://platform.openai.com/docs/guides/model-selection) is the right one for the job at hand.
54
+
To learn more about maanging cost, make sure to use the most optimal models for the type of content you expect your prompts to generate. For example, [1000 tokes is roughly equal to 750 words](https://platform.openai.com/docs/guides/production-best-practices#text-generation); make sure the [model you choose](https://platform.openai.com/docs/guides/model-selection) is the right one for the job at hand.
0 commit comments