How to enable Content Generation

Prev Next

You can enable the AI-powered Content Generation for attributes in PDP.  To use this feature, configure the source attributes that will be used to automatically generate content or descriptions for the selected attributes.

For more information, see How to generate content using AI.

Sample JSON configuration to enable Content Generation icon

{
  "metaInfo": {
    "dataIndex": "config",
    "collectionName": "configObjects",
    "responseObjectName": "response"
  },
  "configObjects": [
    {
      "id": "rock-attribute-apps_contentGenerator_pstdsku_dataSteward_commerceUXConfig",
      "name": "rock-attribute-apps_contentGenerator_pstdsku_dataSteward",
      "type": "commerceUXConfig",
      "data": {
        "contexts": [
          {
            "context": {
              "app": "_DEFAULT",
              "component": "rock-attribute-apps",
              "entityType": "pstdsku",
              "role": "dataSteward"
            },
            "jsonData": {
              "config": {
                "contentGenerator": {
                  "componentname": "rock-wizard-content-generator",
                  "name": "contentGenerator",
                  "icon": "stars-02-ai",
                  "iconColor": "#2D75E2",
                  "bgColor": "var(--flow-primary-100)",
                  "title": "{[ComUXAIGenCntTitle]}",
                  "description": "{[ComUXAIGenCntDesc]}",
                  "visible": true,
                  "applicableAttributes": [
                    "pstdmarketingcopy",
                    "pstdproductdescription"
                  ]
                }
              }
            }
          }
        ]
      }
    }
  ]
}

Sample JSON configuration to define source attributes

{
  "metaInfo": {
    "dataIndex": "config",
    "collectionName": "configObjects",
    "responseObjectName": "response"
  },
  "configObjects": [
    {
      "id": "rock-content-generator_pstdsku_pstproductdescription_dataSteward_commerceUXConfig",
      "name": "rock-content-generator_pstdsku_pstproductdescription_dataSteward",
      "type": "commerceUXConfig",
      "data": {
        "contexts": [
          {
            "context": {
              "app": "_DEFAULT",
              "component": "rock-content-generator",
              "dockingPanel": "pstproductdescription",
              "entityType": "pstdsku",
              "role": "dataSteward"
            },
            "jsonData": {
              "config": {
                "sourceAttributes": [
                  "pstdskuname",
                  "pstdmfgbrandname",
                  "pstdcolor",
                  "pstdsize"
                ],
                "tone": "",
                "firstPromptMessage": "Generate a medium length description using current content, product name, category, and professional tone"
              }
            }
          }
        ]
      }
    }
  ]
}

To enable Content Generation icon and define source attributes:

  1. Download the attached JSON file to enable the Content Generation icon.

rock-attribute-apps_contentGenerator_pstdsku_dataSteward_commerceUXConfig
1.37 KB
  1. Open the rock-attribute-apps_contentGenerator_pstdsku_dataSteward_commerceUXConfig.json file and specify the following:

    Parameters

    Details

    context

    component

    Specify the name of the component to be configured.

    dockingPanel

    Specify the selected attribute for which the source attributes must be configured.

    entityType

    Specify the entity type for which the component is to be configured.

    role

    Specify the role for which the component is to be configured, else _DEFAULT.

    Note: By default, _DEFAULT is specified for role, which implies the component is configured for all roles and users.

    config > contentGenerator

    Specify the following:

    applicableAttributes

    Specify the internal name of the attributes to enable the Content Generation icon.

    For example, pstdmarketingcopy and pstdproductdescription.

    visible

    Show or hide the Content Generation icon for the specified applicable attributes.

    • true – implies the Content Generation icon is displayed corresponding to the attribute in PDP.

    • false – implies the Content Generation icon is hidden corresponding to the attribute in PDP.

  2. Download the attached JSON file to define the source attributes. In this JSON, source attributes for the Product Description attribute is defined.

rock-content-generator_pstdsku_pstproductdescription_dataSteward_commerceUXConfig
1.20 KB
  1. Open the rock-content-generator_pstdsku_pstproductdescription_dataSteward_commerceUXConfig.json file and specify the following:

Parameters

Details

context

component

Specify the name of the component to be configured.

dockingPanel

Specify the selected attribute for which the source attributes must be configured.

entityType

Specify the entity type for which the component is to be configured.

role

Specify the role for which the component is to be configured, else _DEFAULT.

Note: By default, _DEFAULT is specified for role, which implies the component is configured for all roles and users.

config

Specify the following:

sourceAttributes

Specify the source attributes based on which the content or description will be generated for the selected attribute.

tone

Specify the tone of content to be generated, like marketing, professional, casual, and so on.

This is an optional parameter. If this parameter is left empty, the content will be generated in the Professional tone.  

firstPromptMessage

Specify a default prompt message that must be displayed in the Content Generation dialog.

  1. Upload both the JSON configuration files in the Classic UI. For more information, see How to upload UI Configurations.

    In the PDP, the Content Generation icons are displayed for the configured attributes. You can click the icon to generate the descriptions based on the configured source attributes. For more information, see How to generate content using AI.
    ui-configurations-pdp-attributes-content generation-icon.png