Configuration

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/openai-automations/config.yaml
apiKey: $OPENAI_API_KEY
jcr config
apiKey: /path/to/apikey

For more, see Passwords app.

Properties

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)

Azure OpenAI endpoints

From version 1.0.7

To configure Azure OpenAI endpoints you’ll have to add the following decorations

/my-light-module/decorations/openai-automations/restClients/openAI.yaml
baseUrl: https://<your-openai-deployment>.openai.azure.com/openai/deployments/<your-openai-deployment>
components:
  authorization:
    class: info.magnolia.ai.automations.rest.RestAzureClientAuthorizationFilter
restCalls:
  completions:
    queryParameters:
      api-version: 2024-02-15-preview # See https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions  for supported versions
  chatCompletions:
    queryParameters:
      api-version: 2024-02-15-preview # See https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions for supported versions
  imageGeneration:
    queryParameters:
      api-version: 2024-02-15-preview # See https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#image-generation for supported versions

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