Zapier and ChatGPT For Code by Zapier: OpenAI For Writing Code | Tutorial β
Let's build with Zapier and AI (100+ videos)π
2023-07-07
Transcript β
[00:00] welcome back to webcad for AI we do daily teeny I have videos for your personal and business life in today's video we're going to be looking at the zapier block of code and seeing how Ai and automation can integrate with it if you're new to the channel welcome to the series we're tackling all 5000 apps found on zapier's backend and seeing how AI can be integrated with every single one if you're returning visitor and a returning Watcher make sure to like the video let me know that you really like this series let's try to hit 100 likes for today's video but without further Ado let's jump into our zap gear today
[00:30] and essentially what I want to do is I want to see when a new file is added to a Google Drive specifically when a Google doc is added to a Google Drive we're going to grab all the contents found within that Google doc we're going to get a word count for that Google doc and then finally we're going to get a summarization generated by gbt from that Google doc all right so we're gonna go ahead and go up to our name here we're going to do code by zapier as always the automations can be found in the description down below from here though we're going to go ahead and set up our trigger which is going to be a Google Drive and we're going to do the trigger
[01:01] of a new file has been added so we do the events new file in folder continue here and we're going to choose our courses account here found at webcaf AI we're going to hit continue again and then we're going to go ahead and just choose our folder which will be our YouTube zaps just for your reference the document we're looking for here is the sudo legal document right here essentially we want to grab all the information provided in here and push it towards our gbt and zap your flow seems like it wasn't able to find it because the folder that I used was too high up of a parent folder we're gonna have to
[01:33] go one further in which is going to be API access here and then essentially we should be able to find it now so we're going to continue after that as you see here all we need to do in order to find the specific thing we're looking for is we can use this little search bar here and based off all these different records I'm gonna type in the first two three letters of that document pseudo legal document we found it right here so we're going to continue with that selected record from here we're going to go ahead and add our code block so we're going to hit code by zap here and the purpose of the first code block is going to be able to parse the underlying data found within the Google
[02:04] Doc so one thing that you might be running into when you're doing a automation flows is when you're dealing with Google doc a lot of the times the content and the text found within that doc doesn't actually show up on the front end when you're simply just finding it or you know simply trying to grab the data so in order to make sure that that data shows up we're gonna have to use a code block so we're going to do file and then we're essentially looking for file text and as you see here it says exist but not shown that could be an issue if you actually need to know the contents of the underlined dock here so we're going to do is we're going to make our variable here in our code block
[02:35] here we're going to do file text exist but not showing and let's go ahead and name this variable we're going to name it's something as simple as text so now I understand when we refer to text in this code block here it understands we're referring to this specific data point let's go ahead and delete all this code here hit enter a couple times and then let's go and start coding out what we need here in order to expediate both of our times here I'm going to paste it in here and then explain line by line essentially what is occurring first thing that's recurring here is that we are fetching the underlying data
[03:06] provided by text in this line right here we're waiting for a response here and then what we want to do is the output essentially is going to be looking for all the words within that document up to 10 000. so there's a lot of other ways we can structure the underlying format of this you could be finding by characters so now that you understand the general gist of what this block of code is doing essentially what we're doing is we're outputting the first 10 000 words found within the underlying text that we are inputting we can go
[03:38] ahead and proceed here and test this action let me know in the comments down below if you want me to do more tutorials like this specifically with this generate with the AI feature this can be pretty helpful if you are inexperienced when it comes to code from here though we're going to go ahead and hit continue and we're going ahead and test this action all right so as you see here we got our output so the result is the entire document that we wanted here all the way to the end here so we have all the text that was associated with our Google doc so let's go ahead and do a couple things here the first thing we're going to do here is we're going to do another code block here just to show you how
[04:09] intuitive code can get on this platform and then on lastly we're going to add our Chad gbt block here the purposes of this code block is going to be simply just a word counter so essentially we're going to find the input data is going to be the outputs of this one so if we scroll down here which is going to be the results let's go ahead and name this result content and then we can go ahead and delete this again from here we went ahead and putted our block of code here with content equaling input data dot content and essentially what we're looking for here is the
[04:39] output is going to be word count and essentially it's going to take the outputs of the original code block here and it will essentially find the word count and you can do this other ways you can structure this for maybe character count and so on but for the purposes of this tutorial all we care about is word count so we're going to hit test that action and see what the underlying output will be you see here perfect we got our output of 925. let's go ahead and add our chat DVT block here so I'm gonna do chat gbt and we're going to go ahead and do an event of conversation continue continue
[05:12] and let's just do something simple here we're going to go ahead and say uh based on this legal contract summarize it in four sentences your semicolon parentheses and we're going to do the output of the result here and what's great about this is since we're using a summarize function we can state with 3.5 we can hit continue here this may require more tokens depending if the input is too large let's go and see if this works
[05:43] all right perfect so as you see here it has worked perfectly this is a web development service agreement between ABC Corporation XYZ Web Solutions the developer will provide web development services as agreed upon as you see here we could probably structure the output with formatting uh bullet points and so on but it is sufficed for what we were trying to achieve in today's tutorial if you feel like you learned something make sure to like the video it's completely free and it helps us hear web Cafe AI if you want to learn more about Ai and Automation and how to leverage that with zapier and jbt check out the playlist at the end of this video as we're diving into all 5000 apps found on the zapier
[06:15] backend also check out our new Marketplace we just dropped here which is called Web Cafe software where we're selling pre-built AI automation solutions that can be directly input into your projects or client projects but without further Ado I'll see you in the next video thanks for tuning in and yes surprise I'm an AI Avatar make sure to explore more here at web Cafe where we demystify AI for your personal and business life until next time