I’m in a project working with KEHA center for environmental impact assesment. The solution offers the authorities Power Platform user interface where they can use AI as part of the processing and analysis of the statements and opinions given in the consultation. This project is presented in Autumn Power Platform HPR event in Helsinki. For AI there will be ChatGPT 3.5 playing in Azure OpenAI service.

Calling OpenAI is quite easy from Power Automate. You need to get the api-key from Azure and install OpenAI. Then use the Chat Completions REST API for giving prompts and getting responses from ChatGPT.

Power Automate triggering from row creation

I use my error handling format in the flow. I have divided the Power Automate into three scopes for getting prompts (system messages) from Dataverse, then creating responses for each prompt and finally summary of the prompts.

Creating the prompt uses HTTP call and security is handled with api-key.

  • The first message with role assistant is the actual prompt:
    As a assistant, do this and that and think also about NNN and MMM
  • The second message is the content where the ChatGPT will make the responses.

Setting up the OpenAI, applying for the resources and learning how to use took actually more time than the development itself. In my next blog I will tell how to index documents with OpenAI and send prompts for getting responses from the Azure Cognitive Search index.

Following posts