Effortless ChatGPT Integration with Microsoft Teams using Power Automate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone Samir bruneology technical specialist at Microsoft in this video I'll show you how to quickly integrate chat GPT and Microsoft team using power automate so at the end of this video you'll be able to directly ask a question to Jack gbt from a channel in a mic team in Microsoft team and share the access with any of your colleague so before starting first let's look at the prerequisite obviously you'll need to have access to Microsoft team but you also need to be able to create new teams if you don't ask your administrator second you will need power to meet with the proper license as we will use a premium connector so basically you can't use premium connector with the free plan or one of the Microsoft 365 license plan and finally you will need to create an account on beta.openai.com before starting let's discuss the limitation of this method so the first is limitation is not related to the method the method itself but is related to the current state of the openai API right now there's a token limitation of 4097 token so what does that mean uh it means that if you question have a total of 200 250 tokens for instance and the answer is for thousand tokens both will add up and give you a total of 4250 tokens which will exceed the limit the power automatic will then return an error and fill which means you won't get any uncertainty for more detail on how token are calculated visit open API website I'll put the link under the specific article in the video description their second limitation is that this method don't keep the context what do I mean by that is that if you ask a second question after the bot answered you the first time you won't be aware of your initial question or even of his own answer I have a couple admitted in mind to overcome these limitations and I will probably do another video on the subject later but in the meantime if you have any ideas don't hesitate to share them in the comments Jordan last is natural limitation but something you need to keep in mind is that you'll need to start all your prompt with a specific keyword in in this specific part element we'll use chat GPT as the prompt so all that being said let's start with the configuration okay so our first step is the easiest one we will simply need to create a new team so let's go in team click join and create create team from scratch and we'll put it private for now call it chat EPT and that's it obviously if you don't have the right permission to create a team uh chat you'll probably have to ask your admin to give you the proper permission and that was the easiest part next step we will generate the API from chat GPT so we can connect later on on the third step with our power ultimate Russo will navigate to open ai.com click on API and then sign up I will create a new account once your account is created simply navigate to your name at the top right there and click on view API keys and we will create a new secret key and copy the key and keep it for later we will use it in the last step which is to configure our power atomic okay so now we're at the interesting part that's where we will create our power automate in the magic will happen that's the power to me that will query chart GPT and send back the inserted side of Microsoft team to do so let's navigate to make that powerplatform.com make sure you have the proper environment selected then click on flows you flow and we will create an automated cloudflow let's call it chat EPT om integration and we'll use as a trigger a Microsoft team trigger we which trigger when a keyword is mentioned in that case it will be chat gbt click on create and we'll select the message type in that case it will be in the channel of the team we just created so click on Channel and we will ask our flow to trigger when chat GPT inspection so as I've said at the beginning of this video there's some limitation that is you always need to use chat GPT to query chat GPT using this specific flow then from there we will add the team we just created GPT and we will select the channel which is General so our flow will only trigger for the specific team and this specific Channel then we'll want we'll want to retrieve the specific of the questions that we just ask in Microsoft team so we want basically to get the detail of this message that will trigger our flow so let's look for teams connector teams and we will use this get message details action well basically retrieve all the detail of the message that triggered or our power intimate so for the message we will refer to the message ID here and we'll open this get message the message type will be in a channel again we will select our team chat GPT specific Channel which is General in that case obviously you can create another Channel if you want our winning this one and finally we will look for the parent message ID which is reply to message ID here okay then we will that's where we will query chat GPT so we'll do so using an HTTP action let's search for http go we will do a post so we basically will post something to the API and I'll just quickly let's navigate back to the openai website and from there we'll click on documentations if you scroll down you'll see API reference making requests and that's where you'll get the detail on how to make a request to chat GPT so in that case uh here's the model we will use to query so you have this content type that you need to pass in the authorization with the bearer and your API key that we generate in the prior step that you will need to use to uh query gbd from the HTTP request so the content type is application Json so you can just copy past our our type it however you like so our URL is api.mnai.com our errors will be the content type and authorization so let's enter content type and the authorization from there you will need your API key so it needs to be Bearer space and then you'll copy your API key now we will need to enter the Json um with the body of our request okay so again if you navigate to the API documentation and you go to completions and create completions you will see this example of uh creating a completion for a provided prompts with the parameters in that case we will use this one so you can simply copy paste it and we will change our prompter with the detail of the message we just got in the prior step so let's get the body of our message detail and finally we'll we'll change them this Max token to at least 2 000 because if we let it to seven you won't be able to ask questions with uh Ireland then seven character we'll let the temperature as it is and we're done with that part now for the last part we will reply in Microsoft team so let's look for team again and we will reply in the channel reply with a message in the channel we'll pass it as a flow but and we will post post in Channel the message ID will be the initial parent message from our initial message to trigger our flow so reply message ID again we'll select the team Channel and the message will be the answer to our HTTP request if you select the world body of your HTTP request you will receive this answer which is not exactly what we want because it includes all the um the answer itself and it's a bit hard to digest so to only extract the text answer only the text part of the API answer we will create an expression and I will add this expression in the video details so you can just copy paste it so it's body HTTP choices and text so basically what we're doing is we're extracting the text out of this the body of the HTTP request so we'll just click on OK save and that's it we're done we're ready to test our flow Let's test it nearly and now let's go in Microsoft team and see if it works now we're in our chat GPT team in the general Channel now let's just query chat GPT don't forget to start with jat GPT and let's see what the answer is there you go so that's a really interesting answer but now you know how to uh where each RGB from Microsoft team so you can give access to your colleague if you want to we could just play around with chat GPT just keep in mind different limitation I I mentioned at the beginning of the video if you have any questions as always just leave a comment and I'll be more than happy to try to help if you like my video and you want to see more of them please subscribe to my channel thank you for watching
Info
Channel: Samuel Boulanger
Views: 20,524
Rating: undefined out of 5
Keywords: chat gpt, power automate, chatgpt, ChatGPT, Microsoft Teams, Integration, Natural Language Processing, AI, Productivity, Streamlining, Workflow, Efficiency, Time-saving, Tutorial, Communication, Information, Accuracy, Question and Answer, Quick Access, Time Management, Artificial Intelligence, NLP, Machine Learning, Voice Interface, Virtual Assistant, Collaboration., open ai chat gpt
Id: 9i5SGVim55Q
Channel Id: undefined
Length: 12min 22sec (742 seconds)
Published: Mon Jan 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.