Configure AI-powered text fields
Available from version 1.0.5
You can generate text in a textField based on a self-defined translatable prompt which you can enrich with variable content from the dialog properties.
Generate text automatically in a text field based on a developer-defined prompt, which can include dynamic variables from the dialog’s properties.
AI-powered text fields are designed to create tailored content (e.g., descriptions) with minimal user input, streamlining content creation.
-
Use case: Ideal for generating structured, context-specific text, like product descriptions or metadata, based on predefined rules.
-
Example: A field generating a 100-word description using variables from other form fields (e.g., tags).
Configuration
form:
implementationClass: info.magnolia.ui.javascript.form.FormViewWithChangeListener
properties:
#....
description:
$type: aiTextField
prompt: "My wonderful ${paramName} description of what the AI should generate." (1)
words: 100 (2)
rows: 6 (3)
properties: (4)
tags: tags
#...
| Callout | Parameter | Description |
|---|---|---|
1 |
|
required The Variable substitutions are available.
In addition to self-definable variables via the property |
2 |
|
optional, default is `50` Defines the maximum words returned. |
3 |
|
optional, default is `2` Defines the initial height of the textarea. |
4 |
|
optional Defines properties for variable substitution in the prompt. The key is used as name for the variable. The value defines the name of the field from the form definition e.g. of the dialog. |