Skip to main content

Example - Openai Automation

In this example, we will create automation to perform the following actions:

  1. Analyse the invoice using Invoice Analyser activity under Machine Learning.
  2. Convert the output object obtained from 1 to JSON String.
  3. Chat 1: Provide the JSON string as an input message to Chat activity, asking to write the summary of invoice details from the above JSON by enabling the history property.
  4. Obtaining following information by using Chat activity
  • Chat 2: Asking for the total amount of the invoice
  • Chat 3: Getting the vendor address
  • Chat 4: Get the vendor name by setting the use history to false.
  • Chat 5: Getting the vendor name by setting use history to true.

Prerequisites

  • An API Key to connect to Openai.
  • Invoice image file with PNG extension. Shipped the example test file with the example zip.
  • Open Process Designer and create a blank process. Give a name to that process.

Process Designing

  1. Drag and drop Invoice Analyser activity Activity. Configure the following properties:
  • Image Path: Assign the path where your invoice file exists.
  1. Drag and drop Openai context Activity and provide the API Key and choose the appropriate model from the configuration.
  2. Drag and drop the Chat Activity inside the openai context and ask for summarising the JSON string by setting the Add to History property to true.
  3. Now using the Chat Activity getting the following information from invoice:
    • Total amount of invoice.
    • Get the vendor address.
    • Get the vendor name by setting use history to false.
    • Get the vendor name by setting use history to true.
Download Example

Analyse Invoice