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:
Add AI integrations#
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.
Navigate to Integrations in the Uniform app, and select the AI category.
Choose one or more of the available integrations, and click Add to project.
The available AI integrations.
Configure Claude#
When you select the Claude integration, you will need to provide the API key from your Claude account to complete the connection.
Want more information?
See the documentation for this integration.
Configure OctoAI#
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.
Want more information?
See the documentation for this integration.
Configure OpenAI#
When you select the OpenAI integration, you will need to provide your organization, and API key from your account to complete the connection.
Want more information?
See the documentation for this integration.
Configure Writer#
When you select the Writer integration, you will need to provide your organization, team, and API key from your account to complete the connection.
Want more information?
See the documentation for this integration.
Manage prompts#
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.
Create a prompt#
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:
Field Description Prompt name Enter the name by which you want to identify the prompt on the management page. Enabled Once a prompt is enabled it's available in Canvas for use in creating compositions and entities. Current value The 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 locale If 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 text Instructions sent to the generative AI. These instructions can include variables.
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
You will see Current locale and Parameter Reference variables in the playground only if they are used in the prompt text.
Context and availability#
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.
Other options#
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.
Built-in 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.
Use generative AI#
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.
Generate text#
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.
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.
Generate an image#
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.
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.
Generate multiple parameters#
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).
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.