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: Writerside/topics/Configuration_Overview.md
+43-6Lines changed: 43 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -13,17 +13,39 @@ If you have text, textarea, image or image+ Template Variables you wish to use w
13
13
-**text inputs** – modAI uses the base prompt and model and directly inputs the content into the field
14
14
-**textarea inputs** – handled the same as text inputs
15
15
-**richtext inputs** – handled the same as a textarea input, but you must manually copy/paste the output into the textarea
16
-
-**image inputs** – modAI uses the default image model and sizes and creates the imaegs in the `assets/ai` directory
16
+
-**image inputs** – modAI uses the default image model and sizes and creates the images in the `assets/ai` directory
17
17
-**image+ TVs** – handled the same as image inputs, with the addition of being able to use the Vision model for creating alt tag captions from generated images
18
18
19
19
20
20
### Configuring Field Prompts
21
21
22
-
Customize the base prompts and configurations in the `global`, `image`, `resources` and `vision` areas in the system settings as needed. The `modai.global.base.prompt` prepends the base to ever other text or textarea prompt, but it does not for image or vision model prompts.
22
+
Customize the base prompts and configurations in the `global`, `image`, `resources` and `vision` areas in the system settings as needed. The `modai.global.text.base_prompt` prepends the base to ever other text or textarea prompt, but it does not for image or vision model prompts.
23
23
24
24
## Settings Format
25
25
26
-
Settings use the following naming convention: `modai.{res||tv}.{field/tv-name}.{setting}` where `{res||tv}` denotes a default MODX Revolution field or a custom Template Variable (TV) and `field/tv-name` is its actual name (e.g., pagetitle, longtitle, fancy-image-tv, etc.).
26
+
Settings use the following naming convention: `{namespace}.{field}.{type}.{setting}`.
27
+
- Where `namespace` by default is `modai`, but other extras can pass their own to override default settings from their extra.
28
+
- Field in the core modAI can be `res.pagetitle`, `res.longtitle`, `res.introtext`, `res.description`, `res.content` and `tv.tv_name` (for any text/image/image+ TV), but Extras can pass whatever make sense for them (for example TinyMCE RTE will pass `ta` for the content RTE instance). The field can also be `global` which is a fallback for any setting.
29
+
- Type can be one of `text`/`image`/`vision` to denote this setting will get only applied to AI interaction from the specific category
30
+
- Setting is a target setting name like `model`, `temperature`, `quality`
31
+
32
+
All settings drill down from the most specific to the global one, few examples (resolves top to bottom):
33
+
```
34
+
modai.res.content.text.model
35
+
modai.global.text.model
36
+
```
37
+
38
+
```
39
+
modai.tv.poster.image.model
40
+
modai.global.image.model
41
+
```
42
+
43
+
```
44
+
tinymcerte.modai.ta.text.model
45
+
tinymcerte.modai.global.text.model
46
+
modai.ta.text.model
47
+
modai.global.text.model
48
+
```
27
49
28
50
The `setting` for text or textarea inputs can contain several options below which will override the default settings from the `global` area:
29
51
@@ -36,18 +58,33 @@ Image and Image+ fields do not prepend their prompts with the base prompt. Image
36
58
-**model** – defaults to `dall-e-3`
37
59
-**quality** – defaults to `standard`
38
60
-**size** – defaults to `1792x1024`
61
+
-**style** – defaults to `vivid`
39
62
40
-
Image+ fields can use Vision models to describe an imgage for the alt content found in the `vision` area:
63
+
Image+ fields can use Vision models to describe an image for the alt content found in the `vision` area:
41
64
42
65
-**vision.model** – defaults to `gpt-4o-mini`
43
66
67
+
### Custom Options
68
+
If needed, cutom options can be supplied to the AI service by either using the `global` variant of the setting for specific type, for example `modai.global.text.custom_options` and setting it to a JSON object with desired properties, or by using a setting for a specific field like `modai.res.content.text.custom_options`.
69
+
44
70
### Overriding Global Defaults
45
71
46
72
Each field that you attach modAI to can have settings overrides. This means that you can mix and match which models are used for specific fields, allowing you to optimize for cost or quality depending on your application. For example to use Claude Haiku to generate a (very) creative summary for the `[[*introtext]]` field, you would update/create the following settings:
If you'd like to stream the AI response into the UI (see the incrementally generated response), you can do so by enabling `modai.global.text.stream` and/or `modai.global.vision.stream` (as always, you can enable this also for only specific fields).
81
+
82
+
<warningid="warn-streaming">
83
+
Currently streaming only works when the request is executed on client ("modai.api.execute_on_server" is set to "false").
0 commit comments