Add OpenAI/ChatGPT to your Power Automate Desktop Flows

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
to use chat GPT and open AI apis in your power automate desktop flows you go up to actions and here you search for an invoke web service and you drag it in here we will fill in the parameters first we will need a URL and for that we open up a browser and navigate to platform. open.com in case you don't have an API key I created a guide up here it's a two-minute guide that will take you through the steps once that is done we will continue here so first we will go to API reference and scroll a little bit down here to making requests you can see this URL here you will just mark it and copy it over to power automate desktop paste in the URL then the meth that is post we're posting something to this API change the XML to Json and change the XML here then in the headers we need the authorization and for that I go back here you copy all of this contrl C go back to Powermate desktop contrl and instead of this open AI API key here we will um paste in our API key so I go back here then in the browser you click this lock here and here you can see the API Keys we create a new secret key I could call this one power automate desktop and create secret key this key I can copy and when I click done this key is uh hidden and I can never recall it so do save it if you plan to reuse it you can always delete this and create new ones instead then I go back here so instead of all of this I say control v i paste in my API key then we need a request body for that go back here I click done I go up here and click this icon go back to the API reference I scroll down to making requests and what you need here is to copy from this down to this so the curly brackets then we go back to Power automate desktop paste it in here and I like to structure this a little bit better so we can see what going on so here I just inline these a little bit preter it's not needed and I also do this so and again I like to have the curly brackets on each separate lines so I can see what's going on so right now U we also have something called a temperature that is the creativity we actually don't need that you can have it to control the creativity of the model but we will keep it simple and let me do this so we just have the model that is GPT 3.5 turbo we can easily change this to for example the GPT 4 or you can change it to newer models then here we take the role of user and here we give our prompt so let's do something more fun than say this is a test that could be tell a joke about RPA developers one thing that we will need is to go to Advanced and here you will untick the encode request body then we click save now try to run it it will take a few seconds and if I go over here to my variables then what you want here is to find the web service response and double click on it now I can expand it and here you can see we have our joke why don't RPA developers play hide and seek because good luck hiding when they automate the process I'm not sure if it's particularly fun but we have called the open AI API let's expand it because we also need to pass this data if we just took all of this data in the web service response it will be very uh hard to see what's going on so we need to move into this content first we are passing this Json to a custom object and that's because a custom object is easy to work with in power automate desktop so what you do here is to find a convert and then you say convert Json to custom object and drag it in the Json that we want to convert that is the web service response so click the X double click the web service response and here instead of saying Json is custom object then I will just call it response custom object it's optional but then the variable name describes the data a little bit better then I click save now let's try to run it again we do another call and then we will see our response custom object double click here so what I want to do here you can see that we have different keys or names ID object created model choices usage try to click the more on choices and in here our um I click more again and click more here there you have it we have it hidden in the response custom object choices zero because that's the first item in the array message and content we will use this expression to pass out the actual content which is this joke so go find a set variable and drag it in here so this one I will call response and down here I will bind the response custom object and then we will need to add in hard brackets I will say choices like this and then I wanted to find the first element that is zero and then I needed to go into message like this another heart bracket content bracket so now we will have the response in a nice variable so I'll click save here and then we will click run we're just doing the same thing but what I want to see here is that the response variable is now the joke itself that's the output we could just change the prompt and let me show you the huge potential potential here because we don't want to tell jokes we could process invoices or analyze sentiment and here I have a case so in the browser I have reviews for a company that's my company by the way and let's say I want to analyze sentiment on multiple or a single review that came in lately so we'll just do it with one so I'll take this one here and what we will do here is to find a launch new Microsoft Edge so before we do anything we web scrape this social media content in this case a Google review and then we can analyze it with the open AI API here I will not launch a new instance but I will attach to a running instance and I do this and here I'll pick the tab where it says an Yensen or reviews this will create a browser variable I'll click save then I'll will use a get details of element on web page and track it in here we will create a new UI element so I click this drop down I'll say add UI element and I'll just take this sff which is the first review so I'll press control click with my mouse and this UI element has been created let's rename it to review and what this does is that it looks in the UI element it takes the text out and store it in a variable that we now call review I'll click save now I will use this review in my prompt so now it will not be tell a joke and I could open up the here here I could create a variable for the prompt or we can just do this so here I'll say analyze the sentiment and output the result and let's say I just want it in five words so it's easy digestable let's say I have multiple reviews daily of my company so here I'll say the result in five words and by the way if you want to review this video please give it a thumbs up that will really help my channel a lot thank you so here and then I say encapsulate encapsulate uh there salt into and then I'll say two pipes that is just to have it easily a possible once that is done because sometimes it the chat DPT open AI apis add some extra text so now I want to result in here and I'll also say Do not return any other text like this I'll also attach my reviews so here I will say and here come the review codon and and then I will have the review like this so I'll just insert the variable that just got created before I'll click save then I'll click run so the pass adjacent is exactly the same now you can see here it attached to here it did scrape and we go back here and if I go to the response here you can see that we have the sentiment analysis it says that it's positive impressed with power automate training I created a complete guide to do sentiment analysis with power automate desktop and GPT it is right here and you should go watch it
Info
Channel: Anders Jensen
Views: 2,599
Rating: undefined out of 5
Keywords: Power Automate Desktop, ChatGPT integration, sentiment analysis, AI workflow experimentation, tutorial, openai apis, microsoft, chatgpt in power automate desktop, openai in power automate desktop
Id: bs30fngA1kw
Channel Id: undefined
Length: 11min 8sec (668 seconds)
Published: Thu Mar 21 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.