Configuration

UI config

The config.yaml file handles UI configuration and is typically found at /my-light-module/decorations/ai-accelerator-ui/config.yaml.

Parameter Description

supportedFieldDefinitions

required

From version 1.0.5

Defines the field types that are going to be filled out during component, variant or page generation. Default is textField, richTextField and damLinkField.

supportedFieldDefinitions:
  textField: textField
  richTextField: richTextField
  damLinkField: damLinkField
Other field types can be configured but might not work as expected.

availableTemplates

optional

From version 1.0.5

Defines the available templates for page generation in general. Availability rules through the site definition are working independently of this configuration.

availableTemplates:
  Basic:
    id: mtk2:pages/basic

availableComponents

optional

From version 1.0.5

Defines the available component templates for page generation and component generation.

availableComponents:
  Link:
    id: mtk2:components/link

smartInjectTemplates

optional

From version 1.2.0

Defines the available hyper prompt reference templates. They’re used to identify which dialog should be opened.

smartInjectTemplates:
  ref: (1)
    name: JCR Chooser
    dialogId: ui-framework-jcr:chooser
    template: ref:(?<workspace>.*):(?<name>.*)\.(?<field>.*)
    describeByProperty: path
    type: jcr
  pagesRef: (2)
    name: Pages Chooser a
    dialogId: pages-app:chooser
    template: pagesRef:(?<name>.*)\.(?<field>.*)
    describeByProperty: path
    type: jcr
  ecommerceRef: (3)
    name: Product picker
    dialogId: <your-lm>:product-chooser
    template: ecommerceRef:(?<name>.*)\.(?<field>.*)
    describeByProperty: name
    type: ecommerce
  jsonRef: (4)
    name: JSON picker
    dialogId: <your-lm>:json-chooser
    template: jsonRef:(?<name>.*)\.(?<field>.*)
    describeByProperty: name.official
    type: rest
1 Default JCR based reference template (included without configuration).
2 Pages picker reference template (included without configuration)
3 Product picker reference template (Not included. Note: JS fields need to be configured to support Ecommerce Dialogs)
4 REST based item picker (Not included. Note: The dialog has to be configured with a REST based datasource)

defaultExtensions

optional

From version 2.1.0

Defines the default extension available for the aiAssistedTextField.

defaultExtensions:
  - ExpandBlockTool
  - ExpandTool
  #....

OpenAI config

The module configuration can be done via yaml decoration either by specifying the API key directly in yaml or by providing a path to the API key in passwords app.

  • config.yaml file

  • Configuration app

  • Passwords app

/my-light-module/decorations/ai-accelerator-openai/config.yaml
apiKey: $OPENAI_API_KEY
jcr config
apiKey: /path/to/apikey

For more, see Passwords app.

Azure OpenAI config

  • config.yaml file

  • Configuration app

  • Passwords app

/my-light-module/decorations/ai-accelerator-azureai/config.yaml
apiKey: <your-azure-key>
azureDeployment: <your-azure-deployment>
azureResourceName: <your-azure-resource-name>
jcr config
apiKey: /path/to/apikey

For more, see Passwords app.

Using multiple Azure deployments

Azure AI allows you to use multiple model deployments in parallel, even with different endpoints, by creating custom REST client configurations. This is useful when you want to:

  • Use different Azure OpenAI deployments for different models (e.g., GPT-4 in one deployment, DALL-E in another)

  • Connect to different Azure regions or resource names

  • Use separate API keys for different deployments

Custom REST client configurations for model deployment

Create a custom REST client in your light module to connect to a specific Azure OpenAI deployment.

Here is an example for DALL-E-3:

/my-light-module/restClients/azureAI-dalle3.yaml
baseUrl: https://my-resource.cognitiveservices.azure.com/openai/deployments/dall-e-3 (1)
timeoutConfiguration:
  readTimeout: 180
  connectTimeout: 180
components:
  audit:
    class: info.magnolia.ai.rest.RestClientAudit
  header-filter:
    class: info.magnolia.ai.rest.ResponseHeaderFilter
restCalls:
  imageGeneration:
    method: POST
    entityClass: com.fasterxml.jackson.databind.JsonNode
    path: /images/generations
    body: "{body}"
    queryParameters:
      api-version: 2024-08-01-preview
    headers:
      Content-Type: application/json
      api-key: !env ${AZURE_AI_API_KEY} (2)
1 Full Azure OpenAI endpoint URL including the deployment name
2 API key using environment variable (can also use !secret for Passwords app)

Use custom REST client in model definition

Reference your custom REST client in your model definition by setting the restClientId property.

Here, the custom DALL-E-3 REST client is referenced:

/my-light-module/aiModels/azure-dalle-3.yaml
$type: azureImageModel
modelName: Azure OpenAI DALL-E 3
modelVersion: dall-e-3
restClientId: azureAI-dalle3 (1)

input:
  prompt:
    $type: prompt
    required: true
    description: A text description of the desired image(s).
  size:
    $type: enum
    description: The size of the generated images.
    enumValues: [1024x1024, 1792x1024, 1024x1792]
    defaultValue: 1024x1024
  quality:
    $type: enum
    enumValues: [standard, hd]
    defaultValue: standard
  style:
    $type: enum
    enumValues: [vivid, natural]
    defaultValue: vivid

output:
  data:
    $type: list
    itemType: imageUrl
1 Reference your custom REST client by id.

AWS Bedrock config

Connect to AWS Bedrock by following the instructions at Configuring the AWS connection.

  • config.yaml file

  • Configuration app

  • Passwords app

/my-light-module/decorations/ai-accelerator-aws/config.yaml
region:
  name: <you-aws-region>
jcr config

See Configuring the AWS connection: Using the Passwords app for details if using the Passwords app.

fal.ai

Connect to AWS Bedrock by following the instructions at Configuring the AWS connection.

  • config.yaml file

  • Configuration app

  • Passwords app

/my-light-module/decorations/ai-accelerator-fal-ai/config.yaml
apiKey: <your-fal-ai-key>
jcr config
apiKey: /path/to/apikey

For more, see Passwords app.

Google Gemini config

  • config.yaml file

  • Configuration app

  • Passwords app

/my-light-module/decorations/ai-accelerator-gemini/config.yaml
apiKey: <your-google-gemini-key>
jcr config
apiKey: /path/to/apikey

For more, see Passwords app.

Currently only one LLM provider is possible.

Developer samples

Check out some samples here.

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