Configure a Generative AI activity

Use the following procedure to configure a Generative AI activity.

  1. Add an activity to the map.

    By default, the Configuration tab is open in the properties panel of the activity.

  2. Change the default Name of the activity as required.
  3. On the Type list, select Common > Generative AI.
  4. On the Provider list, select the Generative AI provider to use, such as ChatGPT OpenAI or AI Agent.

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

    If you select an AI Agent provider, lists of (standard and additionally added) input and output variables appear.

    • You can set a static value or dynamic variable (form control, form variable, or global variable) for the input and output variables.

    • The output variable included in the standard variables is used to populate the chat control response.

  5. In the Input box, provide the input to the activity that can be a combination of plain text or variables including XML and Data object. For example, "Generate the text for an email."
    The following variables are not supported: Document, Folder, Complex, Dynamic complex, Checklist, and Data backbone.
  6. On the Source list, select one of the following:

    On upgrading TotalAgility from an earlier version, if the Source was set to Inline image, the Source is set to Image.

    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 at runtime.

    All the Generative AI models do not support the use of images, including the Custom LLM.
    1. On the Document list, select either variable type.

      • Document: At runtime, the variable uses base64 string to store the content of the document.

      • String: Select either Mapping type.

        • Instance ID (default): The variable uses the instance ID of the document at runtime.

        • Data as base64 string: The variable uses content of the document as base64 string at runtime.

    2. On the Mime type list, select a file type. The supported mime types are: GIF, JPEG, and PNG (default).

    Text

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

    The response is generated based on the document passed as an input at runtime.

    On the Document list, select either variable type.

    • String: At runtime, the variable uses instance ID of the document.

    • Document (default): The variable uses the instance ID of the document at runtime.

    The following file types that are supported in the Transformation Designer are supported for the text format in TotalAgility at runtime.

    • TIFF (*.tif)

    • JPEG (*.jpg)

    • PNG (*.png)

    • PDF

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

  7. Optional. Select the check box for Use seed (default: Clear) and on the Seed list, provide an inline value or select a numeric variable. (Default: 0 and Maximum: 32,767)

    The seed value increases the likelihood of obtaining more consistent results from the AI provider across repeated requests, though not guaranteed.

  8. On the Response list, select a variable to hold the response for the provided input.

    The response only supports simple type variables, XML, Data object, 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 the input as, "Is the sky color blue?" and a map a boolean variable as a response, the results is displayed as true, and if a String variable is mapped as a response, the result is returned as a text.

  9. Set the process Temperature for the AI provider. (Default: 0.5, Minimum: 0, and Maximum: 2)
  10. You can specify whether the job be suspended if an error is returned from the provider. Do either of the following for Suspend job on error.
    • Leave the option selected (default).

      When you export a process and import it to a target server, the Generative AI activity is executed correctly if the provider is configured with the same name as the source server and the same ID.

    • Clear the check box and map the following process variables:

      • On the Error raised list, select a boolean variable.

      • On the Status code list, select a short variable.

      • On the Error message list, select a string variable.

      When you execute the Generative AI activity and an error occurs, the activity is completed without an error and the process variable mapped to the response is not populated.

  11. Save the process map.

    When you execute this activity, the system does the following:

    • Pass the correct input to the selected AI provider and populates the mapped variable at runtime.

    • Pass the correct image or document text to the AI provider as part of the input and return the response. For example, when you upload a document and request to calculate the total amount in the document, the AI provider calculates the amount and returns the result.

    • Record an audit entry that the Generative AI activity is executed.

    • Pass the base 64 string for the document and the correct document type to the Custom LLM when the Custom LLM provider is used.