Integrating ChatGPT with Copilot through Power Automate
"Image of a professional holographic ai powered chatbot floating in the air with multiple data sources around him", Credit: Dall-E

Integrating ChatGPT with Copilot through Power Automate

Continuing my previous Article in which I showed the way to set up ChatGPT connection in Power Automate flow, I would like to show how this connection can be used in Copilot.

In today’s fast-paced digital environment, organizations constantly seek ways to streamline operations and improve decision-making processes. One innovative approach involves integrating cutting-edge AI technologies, such as OpenAI's ChatGPT, with internal business applications like Copilot via Power Automate. This integration allows companies to leverage AI-generated insights directly in their workflows, significantly enhancing response capabilities and accuracy in various applications, from customer service to internal knowledge management.

Introduction to Power Automate

Power Automate, a component of the Microsoft Power Platform, is designed to help businesses create automated workflows between apps and services. These workflows can synchronize files, get notifications, collect data, and more, all without human intervention. The key advantage is the ability to design processes that trigger responses, perform tasks, and manage data across multiple services automatically.

Why Integrate ChatGPT with Copilot?

ChatGPT, developed by OpenAI, is a powerful language model that can understand and generate human-like text based on the input it receives. Integrating ChatGPT with Copilot through Power Automate enables businesses to:

  • Automate responses to FAQs from customers or employees, reducing workload on human agents.
  • Generate insights and recommendations by processing large volumes of data quickly.
  • Enhance decision-making by providing accurate, data-driven answers and suggestions in real-time.

Requirements:

  • Access to Power Automate.
  • Access to a ChatGPT connector or equivalent service.
  • Access to Copilot.

Setting Up the Integration in Power Automate Flow

The integration of ChatGPT with Copilot involves several steps in Power Automate. Here is how to set it up:

Full picture of Power Automate Flow to be called from and responded to Copilot

Here are the detailed steps for the flow creation:

Step 1: Create a New Flow

  1. Login to Power Automate: Go to Power Automate and log in with your credentials.
  2. Create a new flow: Click on + Create from the left navigation bar, then choose the type of flow you want to create, such as an Automated cloud flow, Instant cloud flow, or Scheduled cloud flow. For this guide, select Instant cloud flow.

Create an Instant cloud flow

Step 2: Configure Flow Trigger

  1. Choose the trigger: Depending on your flow type, choose an appropriate trigger Run a flow from Copilot. Rename your flow in the left top corner, if required.

Choose Run a flow from Copilot

  1. Configure inputs: Add text input that will be the user question from Copilot.

Specify the Input Question from Copilot

Step 3: Initialize Variable

We need this variable for converting the ChatGPT answer into the string format instead of table, as I want to get my answer in Copilot String.

  1. Add an action: Click on + New step.
  2. Search for "Initialize variable": Type in the search bar and select the Initialize variable action.

Initialize the Variable action

  1. Configure the variable: Name: Enter StringHTML. Type: Select String from the dropdown. Value: Leave this blank.

Select the Name of the variable and specify its Type to String

Step 4: Add Chat Completion Action

Please see detailed instructions of how to perform this action in my previous Article.

  1. Add another action: Click on + New step.
  2. Search for "ChatGPT" or similar: Depending on what is available, you might need to choose a relevant action like ChatGPT - Chat Completion.
  3. Set up the action: Enter any required details such as the prompt or model settings.

Step 5: Set Variable

  1. Add the Set variable action: Click on + New step and search for Set variable.

Add the Set variable action

  1. Configure the Set variable action: In the Name select an output StringHTML from previous step Initialize the variable, choose the array message/content, coming from the output of the ChatGPT action.

Select StringHTML variable and select "message/content" from Chat completion action to get the ChatGPT answer

Step 7: Respond to Copilot

  1. Add another action: and search for a Respond to Copilot.

Add Respond to Copilot

  1. Configure the response: Use dynamic content to set the response using the StringHTML variable as an Answer to Copilot.

Send string ChatGPT answer to Copilot

Step 8: Save and Test

  1. Save the flow: Click on the Save button at the top right.
  2. Publish the flow: Click on the Publish button at the top right.
  3. Test the flow: Use the Test button to run the flow and ensure it behaves as expected.

?

Creating a Copilot Topic and using the Power Automate Flow with ChatGPT

Overview:

This guide will walk you through the steps to create a topic in Copilot that captures a user's question and uses the GPT model to generate an answer, which is then relayed back to the user. This flow is particularly useful in scenarios like helpdesks, automated Q&A services, or interactive bots.

The integration of ChatGPT with Copilot through the Power Automate flow involves several steps in Copilot topic. Here is how to set it up:

Copilot topic for getting ChatGPT answers

Detailed steps to Create the Topic:

Step 1: Set Up the Trigger:

1.?????? Login into Copilot studio.

2.?????? Select desired Environment.

3.?????? Select already existing Copilot or create the new one.

4.?????? Navigate to Topics and create the new topic From blank.

Create Topic in Copilot

5.?????? Trigger Type: Choose Dynamic chaining (preview) as the trigger. This allows the flow to start based on dynamic inputs.

6.?????? Description: Optionally, provide a description to explain what the flow does, such as "This flow generates answers to user questions using GPT."

Describe the purpose of the topic for yourself and other copilot makers on your team

Step 2: Capture User Input:

1.?????? Action Type: Add a Question action.

2.?????? Configure:

·??????? Prompt: Enter the text "What is your question?"

·??????? Identify: Choose how you want to capture the response, usually "User's entire response".

·??????? Save Response As: Name the variable to store the user's question, for example, GPTQuestion.

Ask a question and save the answer as a "GPTQuestion" variable

Step 3: Invoke the GPT Model:

1.?????? Action Type: Add an Action that sends the user's question to a GPT model. This could be labeled something like "GPT Chat Completion", depending on your ChatGPT connection flow name in Power Automate.

Select your ChatGPT flow from Power Automate

2.?????? Input: Pass the GPTQuestion variable as input to this action.

3.?????? Output: Ensure the output variable (e.g., Answer) is configured to capture the model's response. Output is the answer from the ChatGPT Flow in Power Automate.

Call ChatGPT Power Automate Flow action with input "GPTQuestion" and output "Answer"

Step 4: Send the Response Back:

1.?????? Action Type: Add a Message action.

2.?????? Message Content: Configure the message text to be "Here is your answer:" followed by the dynamic content Answer which holds the GPT model's output.

Send the response to user in Copilot

Step 5: Save and Test the Flow:

1.?????? Click on Save to save the configuration.

2.?????? Use the Test feature in Power Automate to ensure the flow works as expected. Enter a sample question and check if the correct response is generated.

Test your Copilot with the trigger phrase and question to ChatGPT and get the response back


You can also use this ChatGPT to create generic answers about your data in documents and external databases.

?

Woodley B. Preucil, CFA

Senior Managing Director

5 个月

Alona Soroka Great post! You've raised some interesting points.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了