LLM Prompts

Form ID: (ML202000)

You use this form to create the prompt definition for the LLM. After you create the prompt definition and test it, the model generates an action and adds the corresponding command to the More menu. When you click this command, the model executes the action that you have described in the prompt definition.

This form is available only if the AI Studio feature is enabled on the Enable/Disable Features (CS100000) form.

Form Toolbar

The form toolbar includes only standard buttons. For the list of standard buttons, see Form Toolbar and More Menu.

Summary Area

In this area, you can specify or modify the basic settings of the LLM prompt definition.

Element Description
Active

A check box that you select to make the prompt definition active and to add the LLM command to the source form.

If you need to remove the generated LLM command from the form, you clear this check box.

Prompt ID

Required. The internal name of the prompt definition.

Prompt Name

Required. The display name of the prompt definition.

LLM Connection

The name of the connection that is specified on the LLM Connections (ML201000) form. You can create the prompt definition without a connection; however, you need a connection to test and use the definition.

The lookup table in the this box displays only connections that have been tested—that is, connections with the Active status.

Source Form

Required. The form for which a command should be created.

Attention: You can select only data entry forms.
Button Name

The name of the command on the More menu (and the button on the form toolbar) that the model will generate. When you click this button, the system executes the generated action.

Instructions Tab

On this tab, you add instructions for the LLM in the text area. By default, the tab contains three sections: Context Instructions, Instructions with Input Data, and Output Data Field. You can also add your own sections to refine the instructions, modify existing sections, or remove them. You can optionally use the ## notation or any other notation to mark the headers.

The tab contains the following elements.

Element Description
Context Instructions

General instructions for the model. This could be business context, the description of the role on whose behalf the prompt is executed, or the tone of voice and the style of the text.

Attention: Context instructions provide additional information that affects the results and facilitates the correct execution of the prompt. Avoid removing these instructions; instead, expand them according to your task.
Instructions with Input Data

General description of your task, the description of actions that the model should execute, and the input data that it should use to perform the task.

As input data, you use placeholders—that is, internal names of the fields from the source form enclosed in double parentheses, such as ((Item.InventoryCD)).

Output Data Field

The list of fields that the model should return, information on how it should fill in those fields, and any limitations relevant to the task. You must specify only the fields of the source form for which the command is generated.

You use placeholders for the output data, such as @((Item.InventoryCD)).

Important: If you do not specify any output fields, the system displays an error when you try to generate an example or test the prompt.

The formatting toolbar has the following button.

Insert

Displays the following commands:

  • Input Data Field: Displays a list of available input data fields for selection.
  • Output Data Field: Displays a list of available output data fields for selection.

Output Format Tab

On this tab, you specify how the data that the model returns should be formatted.

You can use only the output fields from the source form. To cause the system to fill in those fields correctly, you must use the special format that the system generates. We do not recommend that you modify this format.

The tab contains the following elements.

Element Description
Output Format Example

An example of the data that the model should return. This example indicates to the model the structure of the return data, which should be in JSON format with the same fields as specified in the Output Data Field section of the Output Format tab.

Important Note

Information about how the returned data should be formatted.

Attention: Avoid removing this section. It provides guidance on what data the model should return and how this data should be formatted, which significantly improved the quality of the results.
The tab also contains the following button.
Generate Example

Generates an example of the returned data.

The system generates an output example for the model by using the output fields specified on the Instructions tab. The system uses arbitrary values for these fields from the database to set the expectations for the response. If you want to add more details to the response, edit the generated example accordingly.

Prompt Testing Section

In this section, you can test the prompt definition by using a record form the database. The section contains the following elements.

Element Description
Example Record

The record that is used to test the prompt definition.

After you select a record, the system adds to the Prompt tab the full prompt that it will send to the model. In this prompt, the system replaces the input fields from the prompt definition with the data of the record that you have selected in this box.

The section also contains the following button.

Test Prompt

Sends the prompt with the data of the example record to the LLM and displays the results on the Preview and Response tabs.

This button is available if a connection is selected in the LLM Connection box.

Preview Tab

This tab shows how the generated data will be displayed on the appropriate form.

Prompt Tab

This tab displays the full prompt that the system will send to the model. This prompt is the combination of the data from the Instructions and Output Format tabs. The system replaces the input fields in the prompt definition with the actual data of the record that you have selected in the Example Record box.

Response Tab

This tab displays the data in JSON format that the model has returned. The system uses this format to update the fields on the source form.