Configure AI-assisted text fields
Available from version 1.1.1
Enhance existing or new text fields with AI-driven tools to assist users in editing or generating text interactively. Transform standard text fields into AI-enhanced ones, offering extensions like summarizing, expanding, or changing tone for flexible content refinement.
AI-powered forms feature allows developers to easily transform any existing text fields in a Magnolia dialog into AI enhanced text fields.
Use the AI-assisted text field in your forms or turn textField into an AI-powered textField.
-
Use case: Best for user-driven content editing, where the AI suggests improvements or generates text based on user interaction.
-
Example: A title field where the user can summarize or expand text with a click, with a max length of 150 characters.
Activation
There are two options to enable aiAssistedTextField in your forms.
-
Single
aiAssistedTextField<light-module-folder>/<light-module-name>/dialogs/<dialog>.yamlform: implementationClass: info.magnolia.ui.javascript.form.FormViewWithChangeListener properties: #.... title: $type: aiAssistedTextField label: Title placeholder: Insert title text here i18n: true #.... -
textFieldtoaiAssistedTextField<light-module-folder>/<light-module-name>/dialogs/<dialog>.yamlform: implementationClass: info.magnolia.ai.automations.ui.AiAssistedFormView (1) properties: #.... title: $type: textField label: Title placeholder: Insert title text here i18n: true maxLength : 150 (2) description: $type: textField label: Description #....1 Using implementationClass: info.magnolia.ai.automations.ui.AiAssistedFormViewconverts all traditionaltextFieldfields toaiAssistedTextFieldfields.2 Optional, allows to limit the number of characters. Generated text will be truncated if the number of characters exceeds the limit.
Configure extension tools for AI-assisted text field
Available from version 2.1.0
By default, all enabled default extensions of the AI Accelerator module (see defaultExtensions) are available in the aiAssistedTextField.
If you choose to use different extensions, use the optional extensions property.
Only enabled extensions are displayed.
#....
title:
$type: aiAssistedTextField (1)
maxLength : 150 (2)
extensions:
SeoMetadataKeywordsBlockTool: (3)
extension: SeoMetadataKeywordsBlockTool (4)
config: (5)
numKeywords: 7
#....
| 1 | Using extensions requires the type explicitly to be set to aiAssistedTextField. |
| 2 | Optional, generated text will be truncated if the number of characters exceeds the limit. |
| 3 | Just a key, the name does not matter |
| 4 | Has to be a name of an enabled ai-accelerator extension |
| 5 | Config depends on the used extension |
The following configuration for the default tools are available for decoration.
| Config | Extension | Description |
|---|---|---|
|
|
|
|
Desired approximate number of words. Default is 50. |
numWords |
|
|
|
|
showDialog |
|
|
|
If |
|
|
| Some extensions make use of extension dialogs that must also be available. The list below shows the extensions and required dialogs. Required dialogs that are not present will result in an error. |
| Extension | Dialog |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
SEO Metadata generation
Available from version 2.1.0
The following extensions are available for seo metadata generation:
-
SeoMetadataDescriptionBlockTool -
SeoMetadataKeywordsBlockTool -
SeoMetadataTitleBlockTool
The extensions for generation of SEO metadata description and title approximate maxLength if defined on the aiAssistedTextField.
The following configurations are available for decoration:
| Config | Description | Availability |
|---|---|---|
|
Properties to exclude for metadata generation. We recommend you include metadata fields to prevent existing bias for the AI. |
|
|
|
|
|
Amount of words to be generated. For descriptions, this number is approximate. For titles, this is the maximum. |
|
|
|
numKeywords |
|
|
Setting maxLength for SEO metadata
You can configure the maxLength parameter to set a maximum number of characters for the generated SEO metadata.
In this case, maxLength is used to verify that the generated text fits the requirement.
However, in rare cases, the generated text might exceed the specified character limit, in which case the text will be truncated.
When both numWords and maxLength are specified, the smaller value is used for word generation.
If the output exceeds the character limit, the number of words may be further reduced, and the generation process will be retried to fit within the constraints.
|
metaDescription:
$type: aiAssistedTextField
extensions:
SeoMetadataBlockTool:
extension: SeoMetadataDescriptionBlockTool
config:
numWords: 35
maxLength : 150 (1)
| 1 | maxLength for the aiAssistedTextField is used in the same way as maxLength in the standard textField. |