|
1 | 1 | # modAI |
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. |
| 2 | +A proof of concept Extra generative AI creation of SEO-related content including page titles, meta titles, meta descriptions, page summaries, and images/alt text that can be used for Open Graph shares or hero sections that are all the rage for the top of web pages. |
3 | 3 |
|
4 | | -The Plugin adds a sparkle (✦) button next to field or labels in the back-end Manager. When clicked, it: |
| 4 | +The Plugin adds a sparkle (✦) button next to fields or labels in the back-end Manager. When clicked, it: |
5 | 5 |
|
6 | | -- use prompts based on the type of content being created, |
7 | | -- use the ChatGPT API to create said content, and |
| 6 | +- uses prompts based on the type of content being created, |
| 7 | +- uses the ChatGPT API to create said content, and |
8 | 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 |
|
12 | 12 | - MODX Revolution 3.x |
13 | | -- A chatGPT API key and credits for the API found at https://platform.openai.com/api-keys |
| 13 | +- A ChatGPT API key from https://platform.openai.com/api-keys |
| 14 | +- Pre-paid credits for API calls—this is different than the $20/month ChatGPT Pro subscription |
14 | 15 |
|
15 | | -This works well with the following Extras, though they’re not required: |
| 16 | +MODX’s modAI Extra plays very well with the following Extras, though they’re not required: |
16 | 17 |
|
17 | | -- image+ – https://extras.modx.com/package/imageplustvinput |
18 | | -- pThumb – https://extras.modx.com/package/pthumb (don't forget to disable the phpThumbOfCacheManager plugin … it’s evil) |
| 18 | +- **image+** – https://extras.modx.com/package/imageplustvinput |
| 19 | +- **pThumb** – https://extras.modx.com/package/pthumb (don't forget to disable the phpThumbOfCacheManager plugin … it’s evil) |
19 | 20 |
|
20 | 21 | ## Configuration |
21 | 22 |
|
22 | | -After installing the Extra, update the `modai.chatgpt_key` (filter by the `modai` namespace) with your ChatGPT API key from |
| 23 | +After installing the Extra, update the `modai.chatgpt_key`—filter by the `modai` namespace to make it easy to find—with your ChatGPT API key. |
23 | 24 |
|
24 | 25 | You can customize the prompts and configurations in the global, image, prompt and vision areas of the `modai` namespace in the system settings. |
25 | 26 |
|
26 | | -The base prompt is appended to every prompt you generate. It can be considered similar to the Customize ChatGPT settings. |
| 27 | +**Note:** modAI 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. |
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 | | - |
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. |
| 29 | +The `modai.prompt.base` can be roughly equated to a light version of ChatGPT’s custom instructions: it prepends the base prompt to ever other prompt for your site. |
31 | 30 |
|
32 | 31 | 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 | 32 |
|
34 | 33 | 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. |
35 | 34 |
|
36 | 35 | ## Usage |
37 | 36 |
|
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 | +Wherever you see a field or a label with a “sparkle button” (✦) next to it, click it to use the chatGPT api to create content in those fileds based on the system settings prompts/configurations. By default, it automatically creates sparkle buttons for several fields as outlined below. Delete the prompt settings to remove modAI’s sparkle buttons and generative AI content creation for those fields: |
39 | 38 |
|
40 | 39 | - **pagetitle** – sometimes used for an H1 tag (~60 characters) |
41 | 40 | - **longtitle** – often used for the SEO Meta Title (should be ~70 characters) |
42 | 41 | - **description** – often used for the SEO Meta Description (should be ~155 characters) |
43 | 42 | - **introtext** – aka Summary, this is used to create a brief summary of the page content field and used to generate images |
44 | 43 | - **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. |
45 | 44 |
|
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 | +If you’re not happy with what modAI generates, click the sparkle button or generate buttons again to generate another variation. You can then use the prev/next navigation buttons to go between the options. When you save, it keeps the option shown and discards the rest. |
| 46 | + |
| 47 | +## Supported ChatGPT Models |
| 48 | + |
| 49 | +For details on current ChatGPT models supported, consult their documentation: |
47 | 50 |
|
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. |
| 51 | +- **text generation** – https://platform.openai.com/docs/guides/text-generation |
| 52 | +- **image to text** – https://platform.openai.com/docs/guides/vision |
| 53 | +- **DALL-E image creation** – https://platform.openai.com/docs/guides/images. |
49 | 54 |
|
50 | 55 | ## Costs |
51 | 56 |
|
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/. |
| 57 | +**OpenAI API credits must be purchased for this Extra to work.** Find costs for the various models at https://openai.com/api/pricing/. |
53 | 58 |
|
54 | 59 | 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