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:
- Navigate to Setup [Table] and click Actions.
- Click Generative AI Action.
- Give the action a name and an optional description.
- Select the template you want the action to generate, or create a new one.
- 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:
- With the Pre-built tab selected, select the template that you'd like to use.
- Click Copy.
- Optionally, modify the Name and Description fields.
- In the Model Account field:
- If you want to use an Agiloft model, select Agiloft.
- If you want to use a custom model from your own OpenAI or Azure OpenAI account, select Existing Enterprise Account and follow these substeps.
- Select your account type from the Model Provider drop-down list.
- Input the API Key and Model Deployment ID, which you can find by accessing your chosen account's website.
- If you chose Azure OpenAI, add the Resource value from your account's website in the Resource field.
- Navigate to the Prompts tab. This is the GenAI Prompt Lab, where you can design and adjust the prompt used to generate text.
- Modify the Prompt Input if required, as well as the Parameters and Postprocessing fields. For more information, see Parameters and Settings.
- Under Test Output, click the lookup icon to choose a record you want to test the prompt on.
- Click Generate. Under Output, you can see what the prompt generated for the record you chose.
- From here, you can repeat steps 5-7 to tweak and test your prompt until you are happy with the outcome.
- Choose an Output Field. This determines which field in your KB will hold the text generated from the template.
- Click Finish.
To make a new template:
- With the Custom tab selected, click New from the Templates tab of a Generative AI action.
- 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.
- In the Model Account field:
- If you want to use an Agiloft model, select Agiloft.
- If you want to use a custom model from your own OpenAI or Azure OpenAI account, select Existing Enterprise Account and follow these substeps.
- Select your account type from the Model Provider drop-down list.
- Input the API Key and Model Deployment ID, which you can find by accessing your chosen account's website.
- If you chose Azure OpenAI, add the Resource value from your account's website in the Resource field
- Navigate to the Prompts tab. This is the GenAI Prompt Lab, where you can design and adjust the prompt used to generate text.
- In Prompt Input, write the natural language you'd like the model to use as a prompt for generating information about a given document.
- Under Test Output, click the lookup icon to choose a record you want to test the prompt on.
- 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.
- From here, you can repeat steps 6-8 to tweak and test your prompt until you are happy with the outcome.
- You can optionally add parameters and postprocessing settings by expanding the Parameters and Settings heading. For more information, see Parameters and Settings.
- Choose an Output Field. This determines which field in your KB will hold the text generated from the template.
- 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:
Parameter | Type | Description | Required |
---|---|---|---|
max_new_tokens | integer | Tokens 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 |
temperature | float | How 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_penalty | float | Reduces 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_p | float | Similar 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.
The regex must find the entire string outside of the matching group, so it's important to have .* at the start and end of the regex string.
If you wanted to extract the date value only, you would add the following code into the field:
{ "regex": ".*date: *([^\n]*).*", "value": "\1" }