Generative AI action

Use the Generative AI action to generate the output using the Generative AI functionality in a form at runtime.

  1. On the form modeling bar, click Actions and click New.

    The New action dialog box is displayed.

  2. On the Type list, select Generative AI.
  3. Change the default Name (Generative AI1) to something meaningful.
  4. Optional. Enter a Description for the action.
  5. On the Provider list, select the Generative AI provider.

    The Provider list includes the providers configured in Integration > Generative AI. See Integrate Generative AI with TotalAgility.

  6. In the Input box, provide the input to the form that can be a combination of simple data types (variables, controls, and data object fields). For example, provide a String variable with the value "Which country is hosting the ICC Cricket World Cup, 2023?".
  7. On the Source list, select one of the following options:

    None (default)

    The response from the AI provider is based on the input provided (plain text or variables).

    Image

    The response is generated based on the image provided.

    1. On the Document list, select the Web capture control.

      All the Generative AI models do not support the use of images, including the Custom LLM.

    2. On the Mime type list, select the file type. (Default: PNG)

      The following mime types are supported: GIF, JPEG, and PNG.

    Text

    If the document has layout text, such as a semi-structured document (invoice, purchase order, and more) or a fixed form, the document text can provide better results when compared to the results returned using a Custom LLM provider.

    On the Document list, select a Web capture control.

    The response is generated based on the text passed as an input at runtime. The text is provided to the AI provider in an optimized (narrated) order.

    • The following file types that are supported in the Transformation Designer are supported for the text source format in TotalAgility:

      • TIFF (*.tif)

      • JPEG (*.jpg)

      • PNG (*.png)

      • PDF

      When you set the source format as text, the standard model configuration is used.

    If the Web capture control was used as a source in TotalAgility 8.0, on upgrading, the Source format is set to Image; otherwise, the source format is set to None.
  8. On the Response list, select a variable (form or global) , or a form control such as Textbox, to hold the response for the provided input.

    The response only supports simple type variables, Data objects, and a list within the Data object.

    Based on the variable type mapped to the response, the result is displayed. For example, if you provide "When did World War II start?" as the input and map a String variable to the response, the result is displayed as "1 September 1939"; however, if you map a Date variable to the response, the result is returned as "01/09/1939".

  9. Click Add.

    The newly created action is added to the table.

  10. Associate the action with the control to trigger this action. See Configure actions for form control events. Alternatively, to call this action for a form event, associate the action with the form. See Associate an action with a form.

    When this action is triggered, the output is populated correctly and an audit entry is recorded that the Generative AI form action is executed.

    The correct image or document text is passed to the provider as part of the input and the response is returned. For example, upload an image of car registration and request the AI provider to get the registration number as response. You need not save the document in the Web capture control to have the Document ID populated.