Generative AI

Digital teams are constantly creating and iterating on experiences for their audiences. Uniform enables them to leverage generative AI from within compositions or content entries to ease the creation of optimized experiences.

Content or technical architects, or other team members responsible for modeling components and content types will:

Generative AI in Uniform starts with integrations. Three services are available in the AI section of the integrations page of the application:

  • OctoAI Stable Diffusion - Bring Stable Diffusion models into generating images for your entries and compositions.
  • Claude - Use Claude 3 models for generation content for entries and compositions.
  • OpenAI - Generate textual content for entries and compositions.
  • Writer - An alternate source for generating text.

Adding an AI integration is the same as adding any other integration to your Uniform project.

  1. Navigate to Integrations in the Uniform app, and select the AI category.

  2. Choose one or more of the available integrations, and click Add to project.

    add-ai-integration
    The available AI integrations.

When you select the Claude integration, you will need to provide the API key from your Claude account to complete the connection.

configure-claude-integration
Enter your credentials to complete the integration.

Want more information?

See the documentation for this integration.

When you select the OctoAI integration, you will need to provide the API endpoint and API key from your OctoAI account to complete the connection.

add-octoai-integration
Enter your credentials to complete the integration.

Want more information?

See the documentation for this integration.

When you select the OpenAI integration, you will need to provide your organization, and API key from your account to complete the connection.

add-openai-integration
Enter your credentials to complete the integration.

Want more information?

See the documentation for this integration.

When you select the Writer integration, you will need to provide your organization, team, and API key from your account to complete the connection.

add-writerai-integration
Enter your credentials to complete the integration.

Want more information?

See the documentation for this integration.

Once an AI integration has been added to your project, you can manage prompts under Settings > Prompts.

Prompts contain the instructions you give a large language model to generate an intended output. Team administrators, or whoever is responsible for setting up components and content types for composition authors can set up the prompts for authors to use when generating content. This requires the Manage Component Library permission. These prompts will be available to authors of entries or compositions.

To create a prompt:

  • Navigate to Settings > Prompts within your project.
  • Click the Add prompt button.
  • Select which AI service you want to create a prompt for and click Add.
  • Enter the following values for the prompt:
    FieldDescription
    Prompt nameEnter the name by which you want to identify the prompt on the management page.
    EnabledOnce a prompt is enabled it's available in Canvas for use in creating compositions and entities.
    Current valueThe current value input box mimics the parameter or field value and fills in the current value variable. Only shown if the prompt text contains Current value variable. Once a prompt and (if applicable) variables are entered and a response is generated, the output is entered in this field.
    Current localeIf your project has more than one configured locale, you can use this variable in the prompt text. Only shown if the prompt text contains Current locale variable.
    Generate (button)This button activates the process of generating a response to the prompt.
    Prompt textInstructions sent to the generative AI. These instructions can include variables.

Clicking add variable opens a drawer in which you can configure a variable to include as part of the prompt. These variables could be product names or any other indicators that could be of use to your composition authors. Multiple variables can be made available for addition into the prompt. The system will expect a value for every variable in the prompt to be added before generating a response.

There are some variables provided by Uniform and available to insertion into prompts:

  • Current Value: This is populated from the current parameter value.
  • Current Locale: This is populated from the currently active locale. Only available if your project has more any configured locales
  • Properties list: Available only for Multiple text parameters. It will be populated with the list of all text parameters/fields labels in JSON format.
  • Properties current values: Available only for Multiple text parameters. It will be populated with the list of all text parameters/fields labels and their values in JSON format.
  • Audience: Any audience configured within your project will be available for insertion into a prompt.

You can add a reference to another parameter/field by creating a custom variable with name starting from parameter: and following with Public ID of the parameter/field you'd like to reference. For example, parameter:eyebrowText. You can specify Display Name for this variable to keep it more user-friendly

add-parameter-reference-variable
Adding a variable to a prompt.

You will see Current locale and Parameter Reference variables in the playground only if they are used in the prompt text.

prompt-with-parameter-reference-vars
Prompt editor view with both current locale and parameter reference variables.

When you create a prompt you can configure it to appear on either text or assets parameter/fields. These should be used as expected:

  • Text parameters and fields expect text.
  • Asset parameters and fields expect binary files.

There is a third option Multiple text parameters that allows to consume and generate all text parameters/fields of the composition/entry at once.

On the prompt management page, you can access additional management options through opening the menu under . From this menu you can:

  • Duplicate the prompt for easy creation of new prompts.
  • Disable the prompt to prevent it from being accessed from within compositions and entries.
  • Delete the prompt.
manage-prompts
The options available for managing prompts.

Each AI integration comes with preconfigured prompts ready for use in compositions or entries.

About build-in prompts

For more information about built-in prompts, see the documentation page for the AI integration.

attention

Built-in prompts can't be edited so that Uniform can actively manage and update prompts based on customer feedback. You can replace built-in prompts with custom ones by duplicating and disabling the original ones.

Now that you have installed the integration and configured your prompts, teams can start generating content in their compositions and entries.

All text and asset parameters and fields will have a new AI icon in authoring views.

ai-icon-on-text-field
The AI icon that has been added to a text field.

Clicking the AI icon on a text field will open a drawer in which any text already entered is shown, along with any available prompts.

open-ai-to-generate-text
Available prompts for generating text.

Once you select a prompt you will be able to:

  • See the current contents of the parameter or field (if any)
  • Enter prompt variables (if applicable)
  • Generate a result

From the generated result you can:

  • Edit variables (if applicable) and regenerate
  • Regenerate to get a new response to the prompt.
  • Edit what was returned.
  • Accept what was generated. The text will then be entered into the field or parameter.
  • Cancel the action.
work-with-prompt
An example of working with a prompt from a parameter or field.

Clicking the AI icon on an asset parameter or field will open a drawer in which any image already entered is shown, along with any available prompts.

open-ai-to-generate-image
Available prompts for generating images.

Once you select a prompt you will be able to:

  • See the current contents of the parameter or field (if any)
  • Enter prompt variables (if applicable)
  • Generate a result

From the generated result you can:

  • Edit variables (if applicable) and regenerate.
  • Regenerate to get a new response to the prompt.
  • Select an image.
  • Open a full size preview in the modal window.
  • Accept what was generated. The image will then be entered into the field or parameter.
  • Cancel the action.
work-with-prompt-image
An example of working with a prompt from a parameter or field.

Clicking the AI icon on a component parameters header "Parameters" or entry fields header "Fields" will open a drawer in which you will see JSON representation of all text parameters (other types are coming later).

work-with-prompt-multi-text
Available prompts for generating multiple parameters.

Once you select a prompt you will be able to:

  • See the current contents of the parameter in JSON format. Because it is how AI will see it as well.
  • Enter prompt variables (if applicable)
  • Generate a result

From the generated result you can:

  • Edit variables (if applicable) and regenerate.
  • Regenerate to get a new response to the prompt.
  • Edit what was returned, but be aware that it should be valid JSON in the end. This UI is a subject for changes in the future.
  • Accept what was generated. The text will then be entered into the field or parameter.
  • Cancel the action.
work-with-prompt-multi-text-results
Result of multiple text parameters generation.