Page tree

Generative AI Action

Generative AI actions allow you to configure generative capabilities in the GenAI Prompt Lab, which can then be triggered by a rule or action button. These generative capabilities are referred to as templates. For example, you might use the Prompt Lab to build a template that generates a text description for a given contract document.

Prerequisites

This action is only available with the AI Platform (Core) license.

Create an Action

To create a Generative AI action:

  1. Navigate to Setup [Table] and click Actions.
  2. Click Generative AI Action.
  3. Give the action a name and an optional description.
  4. Select the template you want the action to generate, or create a new one.
  5. Click Finish.

Create New Templates

You can create your own templates in the GenAI Prompt Lab by copying a pre-built template or starting from scratch.

To use a pre-built template:

  1. With the Pre-built tab selected, select the template that you'd like to use.
  2. Click Copy.
  3. Modify the Name, Description, Model Account, and Model Provider fields if necessary.
  4. Navigate to the Prompts tab. This is the GenAI Prompt Lab, where you can design and adjust the prompt used to generate text.
  5. Modify the Prompt Input if required, as well as the Parameters and Postprocessing fields. For more information, see Parameters and Settings.
  6. Under Test Output, click the lookup icon to choose a record you want to test the prompt on.
  7. Click Generate. Under Output, you can see what the prompt generated for the record you chose.
  8. From here, you can repeat steps 5-7 to tweak and test your prompt until you are happy with the outcome.
  9. Choose an Output Field. This determines which field in your KB will hold the text generated from the template.
  10. Click Finish.

To make a new template:

  1. With the Custom tab selected, click New from the Templates tab of a Generative AI action.
  2. The template a name and description will match the name and description of the Generative AI action. If you'd like, you can change it here.
  3. Choose the Model Account you'd like to use.
  4. Choose the AI Model Provider you'd like to use for generation.
  5. Navigate to the Prompts tab. This is the GenAI Prompt Lab, where you can design and adjust the prompt used to generate text.
  6. In Prompt Input, write the natural language you'd like the model to use as a prompt for generating information about a given document.
  7. Under Test Output, click the lookup icon to choose a record you want to test the prompt on.
  8. Click Generate. Under Output, you can see what the prompt generated for the record you chose. This is an example of what your template will generate.
  9. From here, you can repeat steps 6-8 to tweak and test your prompt until you are happy with the outcome.
  10. You can optionally add parameters and postprocessing settings by expanding the Parameters and Settings heading. For more information, see Parameters and Settings.
  11. Choose an Output Field. This determines which field in your KB will hold the text generated from the template.
  12. Click Finish.

Parameters and Settings

This section shows ways to use the Parameters and Postprocessing options.

Parameters

Parameters include the following typical large-language model (LLM) parameters:

ParameterTypeDescriptionRequired
max_new_tokensintegerTokens are data reflecting how words are broken down for use in a model. This determines how many tokens the model is allowed to generate, with a token being approximately 4-5 characters. The model won't aim for that number; rather, it is the cutoff.Optional
temperaturefloatHow creative the response should be, from 0 to 1 with 1 being the most creative, with word choices. Don't use this parameter and top_p in the same action.Optional
repetition_penaltyfloatReduces the likeliness of generating a word that has already appeared in the text. In most cases, leave this set to the default of 1, which does not penalize repetition.Optional
top_pfloatSimilar to temperature and limits the diversity of the generated output from 0 to 1. Don't use this parameter and temperature in the same action.Optional

Postprocessing

This field allows you to control your output with Regex.

For example, consider if your model output contained the following data:

{
	day: Friday
	date: 04-12-2024 
	time: 18:00
}

To get isolated information, match the value in the example regex expression with the desired parameter key in the output code.

For example, if you wanted to extract the date value only, you would add the following code into the field:

{
 	regex: ".*date: *([^\n]*).*",
 	value: "\1"
 }