OpenAI ChatGPT integration into Microsoft Teams [How-To Guide]

DMLRD Blog
6 min readApr 18, 2023

--

Its OpenAI ChatGPT everywhere! Except, it wasn’t there for our internal Microsoft Teams at Qritive!

So, I rolled up my sleeves and implemented it. Lot of tutorials out there for integrating ChatGPT but wouldnt you know it, none of them were fool proof. Something or the other kept breaking. So, I fixed it :D and updated it to use the latest gpt-3.5-turbo model instead of the text-davinci-003 model shown in most tutorials.

Here is ChatGPT in action in MS Team (powered by MS Power Automate)

For the source code and technical details please visit the GitHub repo: https://github.com/dmlrd/DooMLoRD-Easy-ChatGPT-Integrator

Note: This information is working and valid as on 7 am IST [GMT+5:30] 18th April 2023. As the saying goes: (Hindi) “Parivartan sansar ka niyam hai” [English Translation: “The change is the law of the nature.”] Things change, systems evolve, API parameters changes. Don’t come after me with pitchforks if things stop working :) Rather contribute pull requests on the above repo to keep it updated!

Thanks to

Special thanks to my dear friends Aneesh Sathe & Abhishek Karmakar for getting me hooked onto ChatGPT!

And thanks to the commuity and all the contributors who make these how-to guides! Don't forget to check out the Credits and References section towards the end of this blog!

Pre-Requisites

OpenAI API Key — We will be using OpenAI’s APIs for which we will need the API keys for authentication with OpenAI servers. Visit your [API Keys](https://platform.openai.com/account/api-keys) page to retrieve the API key you’ll use in your requests. Here is a how-to on how to get the OpenAI API access key. OpenAI provides this as a paid service for higher volumes, but initially it gives you some credits to use for free.

Admin Access to MS Team — I don’t think you can do this without the Admin access, but someone can check and let me know

Power Automate License / Free Plan — Free Plan provided by Power Automate for 3 months; also need the HTTP web-hook premium license (free plan available for few months)

Required the open source package — ChatGPT (gpt-3.5-turbo) in Microsoft Teams using Power Automate [Download Now]

Step-by-Step Guide

Open MS Power Automate: Go to My Flows => Cloud Flows

Select Import => Import Package (Legacy) the Cloud Flow package

Following screen will appear; click Upload button to select the release zip package

The package will start uploading

Once the upload is completed, you will get the “Import Package” — Package details page

Click on the “Select during import” link in the “Related resources” section

If you have an existing connection select that one, else click on “Create New”, this will open new window/tab. In the following page that comes up, search for “Teams” and select the one shown as “Microsoft Teams”

The following pop-up will be shown, click Create

This will now start the Microsoft Login page, select your active Microsoft account and proceed. Once that's done you will see a new connection as follows:

Now you can go back to the window/tab where you were importing the package. Click “Refresh List” till you see the new connector. Select the new connector and click “Save”

Now you can click on “Import” to import this pre-built cloud flow package

You will get progress information too as the package is getting imported

Once its done, you will see the success screen. Click on the “Open Flow” link

Following section is the MOST important one; please be careful what you select!

Click on each box and expand it, this will be the first one:

This basically tells the system to look for the keyword “ChatGPT” in particular channel on MS Team. Click the <[GROUP_ID_GOES_HERE]> (click the CROSS next to it) and select the Team where you want this integrated. Then click on <[CHANNEL_SELECTION_HERE]> (click the CROSS next to it) to select the particular channel under that selected team.

*** Since all these are experimental, my suggestion is to create a new Team and a dedicated Channel under it.

Then click on next section

Keep clicking on each and keep expanding these 3 sections. In the first section “Get message details” again enter similar information as the one in 1st part

Next section is actually the most important one where we are connecting to OpenAI’s ChatGPT APIs. Here give you API key provided by OpenAI:

Once you have entered the key, now go to the next section and add the same details as the 1st step (Team & Channel selection):

Then click “Save”. You will now see the following prompt.

Now go back to the “My flows” page and click on the overflow menu (More Commands) and select “Turn on

Thats it the Integration is now completed! Lets test it out now. Go to that particular Teams Channel and ask ChatGPT what you want:

You can see this invocation now in the Power Automate platform too:

Enjoy ChatGPT in your MS Teams!

Credits & References

Learn how to add ChatGPT to Microsoft Teams — ForTechSupport.com

Learn how to add ChatGPT to Microsoft Teams — Power Platform Community

ChatGPT With Microsoft Teams (linkedin.com)

--

--

No responses yet