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.

Recap
  • 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

Example definition
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

prompt

required

The prompt field defines the instruction given to the AI to generate the text value. It can be either fixed in the field definition or defined by the i18n property key.

Variable substitutions are available. In addition to self-definable variables via the property properties, the ${lang} variable is also available. This variable inserts the language currently being edited at the position used.

2

words

optional, default is `50`

Defines the maximum words returned.

3

rows

optional, default is `2`

Defines the initial height of the textarea.

4

properties

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.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the AI Accelerator module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules