Add a Generative AI activity

Use the following procedure to use the Generative AI functionality within your workflow solution. The Generative AI activity type is also available when configuring a true/false condition and a loop.

Before you begin

Make sure the Generative AI provider is already configured. When adding a Generative AI activity, if a provider is not configured, a message appears.

You can configure the AI provider in either way:

  • In TotalAgility Studio. See Configure the Generative AI provider.

  • In TotalAgility Advanced Studio. Refer to "Integrate with TotalAgility" in the TotalAgility Advanced Studio Help

Procedure

  1. Select below the Start node or any other node

    The Add activity dialog box is displayed.

  2. Change the default Name of the activity as required.
  3. On the Type list, select Generative AI.
  4. By default, "Generative AI" appears as the Title. You can change the title as needed.
  5. The Provider list includes the list of providers already configured in the Integration module of TotalAgility Advanced Studio . Select the Generative AI provider (OpenAI, Azure OpenAI, or Custom LLM).

    When you select a provider, a list of (standard and additionally added) input variables and a list of 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.

  6. On the Source list, select one of the following options:

    On upgrading TotalAgility from an earlier version, if the Source that was set to Inline image is now 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.

    Only single-page documents are supported.
    1. On the Document list, select either variable type:

      • Document: At runtime, the variable uses a 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 the content of the document as a 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 layout text is, for example, a semi-structured document (invoice, purchase order, and more) or a fixed form, the text format can provide better results compared to the results returned using a Custom LLM provider.

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

    On the Document list, select either variable type:

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

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

    The following file types supported in the Transformation Designer are also 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. On the Response list, select a variable, such as String, to hold the response for the provided input.
  8. Set the process Temperature for the AI provider. (Default: 0.5, Minimum: 0, and Maximum: 2)

    This parameter controls the level of creativity in the AI-generated text, providing more focused or diverse text. A higher temperature means the model takes more risks, giving you a mixed response.

  9. Specify a State to be set when the workflow reaches this point.
  10. Select Add.

    The Generative AI node is added, and the updated properties are displayed in the properties panel.

  11. When you publish the solution, the corresponding settings are populated in the generated workflow and the system does the following:
    • Passes the correct input to the selected AI provider and populates the mapped variable at runtime.

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

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