Lesson 11 - ChatGPT Blocks in Zapier: Outputs [PART 2] β
Start an AI Automation Businessπ
2024-07-31
Transcript β
[00:00] perfect you have a grasp on the use cases for an open AI block now let's jump into the meat here which is going to be your chat gbt block let's learn everything we need to know about the Chad gbt block so when we approach AI automations we are going to be really well versed and be able to do a lot of stuff as always your main event when using a Chad gbg block is going to be conversation so if you didn't have a chance to watch our zapier tutorial in the course go ahead and check that out as we describe all this information that falls below the user prompt here but
[00:30] essentially the two main things we're going to be looking at in this video is going to be the user message and the memory key okay so let's go ahead and begin let's go ahead and show you everything you need to know about step by step when creating a prompt for whatever you may be doing first thing you always want to do is just give context so essentially you do context and then in these parentheses you will input what action is being achieved so what do I mean by that are we sending an
[01:02] email did we receive a message from a potential lead are are we creating a video script are we creating social media captions so this is the kind of thought process you should have at the very beginning of a prompt because essentially we want to Proctor
[01:32] gbt to understand all right here start on the right foot so everything after it is a little bit more context on what it should be achieving one side note it's very important that when you're structuring these prompts use very effective dictation you want to use as limited amount of words when providing the prompts because this is going to be not only less data for gbt to understand it's actually going to be cheaper for you in the long term when you scale because every single one of these characters are going to be associated with a token usage by open AI so let me
[02:04] go ahead and give an example of that I'm going to go ahead and delete this and let's just say we are going to do okay we are generating a body for an email for a potential client who seems to be interested so we have that as a context and we continue we continue we continue but using more fine tune dictation here
[02:35] let's go ahead and revamp it a little so we use less data so we're going to go ahead and just delete this we're going to say creating a body of an email for I'm going just going ahead all this for interested client now this might not seem like a big deal but trust me me it really is when you get in more complex AI automations the amount of words you use within us each user prompt is very
[03:07] important it leaves less room for air the more words you provide the more chance you could have um you know probabilities and outcomes that are not within line what you're looking for perfect once we understand the context of what this specific Block's going to do we need to then tell it um essentially what action to perform or what output we're looking for so in this context we like using the term generate say generate the body of this email now before that there may be a
[03:41] chance where we need to use contextual data found previous in the flow so typically the way we want to structure this is we'll give context so in this what we're doing here is creating a body of an email and then preceding that we need to give information that's going to probably be live data based off um you know maybe an email that we rece received so to clarify essentially the way you want to look at it is we want to go ahead and give gbt um context but data oriented context so we're going to email subject email
[04:12] body and then here in these little parentheses is where you're going to want to put the data um of the subject which would become come from like a Gmail block and then you would put the data of the body which would come from the GB um from the GMA block as well so essentially what we're doing here is we're giving context hey we're creating a body even email for an interested client and then it's going to be like okay so who is this interested client then we don't understand this ises context that essentially the interested client and we're going go ahead and add this be make more specific client email
[04:42] subject and client email body now understands okay this was the email that the uh that we need to respond to here's the data that's going to be live data inputed for every time the flow is Ran So maybe a new client comes in we're going to have new subject line new body now let's go ahead and generate the body this email in response and one little trick that you can do when proctoring Generations is sometimes it can get annoying where essentially in this context let's say we generated this out it says email body
[05:14] semicolon uh quotation marks and then it gives you the emao body but what if we just want the email body itself no text before or after quite literally just said it all you need to tell J jbt is no text before or after the body that phrasing right there that right there if I can speak it's going to help you a lot now one thing I noticed that I glossed over real quick is the parentheses those are very important when inputting data so what I mean by data essentially is previous blocks so let's just assume we're using this data point you always
[05:44] want to use parentheses for data points as this allows gbt to comp paralize it when it's looking at all the information you provide within your us message user message so it doesn't like overlap with the generation uh flow or anything like that all right so now that we have essentially what's incurring we may need to add a little bit more information so that it does the correct way or formatting for the output and what we like to use here is called a parameter block so we'll do parameter and you always want to make sure you have your
[06:14] parameter block at the end of the user message I wouldn't want to put the parameter block uh right after this as you know gbt doesn't necessarily always think chronologically but in order to ensure effective outputs have it at the end because then it'll like okay we understand what we're doing all right it looks like we have to do it within these constraints so here are some examples of parameters so we could do Max three to four sentences if you're dealing with social media captions uh Max 200
[06:48] characters and if you want specific keywords use these words and use semicolon quotation marks uh fun and we're going to just add a cost efficient now in the email it knows to essentially use the word fun in it once use the word cost efficient ones also notice how I identify the words that I want used we use quotation marks to identify static text that you want to be inputed into a variable output so just
[07:18] to be more clear on that essentially due the fact that this right here isn't a variable data point it's a static text that we inputed that we want on every single flow we want those two words we're going to use quotation marks and not uh parentheses so those are some examples on essentially parameters think of parameters as your way to really hone in ch gbt and make sure it stays within boundaries that you set about your specific outputs this can be Ed in a plethora different use cases I could have also added you know only like three
[07:49] to five hashtags for doing with social media uh another block we like to use which is circumstantial it's going to be a format block now in the context of using a format block this is where you're going to be able to format for specific language types and what I mean by that is essentially let's say we want to say use HTML use um python you know python wouldn't make sense in this context but in this context you outputting code that's where that would makees sense this is kind of where you want to give more language oriented changes so format
[08:21] could be uh use English use Spanish that is kind of where this comes into play all right so you have a really good idea of how to structure a prompt essentially we want to give context and then we want to give the variables that tend to be associated with that context then we want to give the action of generating whatever we want to generate so for this we're doing generating a body of an email and then we could use format if it is needed within that block and finally we have a parameter block to really give the boundaries of our output the next
[08:51] thing we really got to understand is going to be the memory key so the memory key in itself is 32 characters random string the way we use a memory key think of it like using traditional chat gbt UI on the website you know when you're just talking with chat gbt traditionally uh text to text what you'll notice is that the further you get down in a conversation it remembers stuff you said before so it gives more context on later outputs what does that mean for this API essentially this is where we're going to
[09:21] ensure consistent outputs for formatting and also consistent outputs on variety so what do I mean by that essentially when we use a memory key and we generated the body once we'll be able to make sure that we ensure that the body of the email has a similar style every single time so let's say once we lock in our memory key let's say our memory key is uh uh soccer once we lock in the memory key of soccer and we're satisfied with the output and every single a automation
[09:52] that incurs after that will have similar formatting so there won't be quotation marks or there won't be emojis or maybe there will be emojis it just depends on how you want your formatting output to incur what does that mean that means essentially that sometimes when you're dealing with structuring your user message you may not even need to come back to the original user message and input more text or change anything your user message might be fine all you may need to do in some context is simply add a one here or two here change the memory key retest the action and if the output
[10:23] is more satisfactory then there you go you found your memory key you want to stick with for that specific output so that is on the formatting and output side what about the memory side this is a big deal here so essentially think of it this way what we get into later in this course is our AI article generator and one of the big things about content creation and content generation and basically this can be applied to a lot of things within business is the idea that we don't re want regurgitated information as and as a reader you would
[10:54] to want to read the same article two weeks later right therefore using a memory key and then adding a line like this for example uh parameter never repeat the same uh body and this doesn't really make sense in this context because it want to be able to repeat the same body due to the fact that we got variables here but we could say um in the context that maybe we created a chat gbt block for the purpose of coming up of article titles or article topics we would add a line that essentially says never repeat the same article topic and
[11:27] you'll learn this in the course later on so you'll see more in depth on this but essentially what this does for us is that we wouldn't have you know our article come out on Monday and then Sunday that same week it's the exact same topic by having a memory key here we can use contextual information that was said in the past in order to ensure variety of output what does that mean for you that means we can really ensure quality with our outputs when it comes to scale and when you deal with multiple clients you don't have to worry about XYZ client being like we already had
[11:58] this article in incur two weeks ago now you can ensure that the variety of topics will stay true and consistent with the businesses you do business with now you have a good idea on formatting let's go ahead and run through some tricks here that you can do with Chad gbt in order to ensure more effective outputs let's start off by understanding how to maybe take a large piece of data make it more digestible for gbt therefore having a better output so for this example let's go ahead and upper
[12:28] mod model to gbt 3.56k and what we're going to do here is essentially we're going to say generate uh 400 words about uh on a madeup kid story so essentially let's just create a lot of data right now so then we can use it in our next block so we're going to do that and I might have needed to increase the max tokens here but let's go and see perfect so as you see here we got a lot of data a lot of text now when you you deal with that
[12:59] much data whether it's from a Google doc or a PDF there are two main reasons why you wouldn't want to input that into a cat gbt block that is running on gbt 4 that is going to be cost and effectiveness of output first reason of cost is that chat gbt for every single one of those characters are going to be charged at a 06 Cent rate compared to a gbt 3.5 which is 002 the second reason is we want more effective outputs here so let's go ahead and show you a cool little trick that we can use 3.5 in par for in order to
[13:30] handle this data better go ahead and create a chat gbt block here going to do an event of conversation continue continue we're going to do based off this story and put all that data that we just had here come down here we're going to up it to 3.56k because we are dealing with more data in this context and 16k can handle more data we're going to say generate the three main points
[14:03] parameters Max one sentence uh what do one one to two s h one sentence sometimes gbt gets a little crazy uh per point and then we're ahead continue and test this action now whatever context you may be digesting the data for you would make that the main point that you want to come out of the next flow here this is due to the fact that maybe you're sihing through a PDF and you want to have you know maybe the four main points about XYZ therefore grabbing all that and you
[14:34] want to have gbt for search the PDF all right so as you see here we got our three main points so then what you would do with the digestible data that you just received You' add another chat gbt block here and we would do a conversation and then we can now up it to gbt 4 the more cost strenuous model but the more effective model when it comes to comprehension so I do gbg4 here and we go ahead and say say based off the summary of this story semicolon parenthesis input
[15:08] this we're going to say maybe the comprehension in this level is going to say generate a six question quiz multiple choice and there you go essentially now whatever the comprehension level task you usually associate with gbt is going to be able to take the relevant data that's important for that task and now generate with it at a lot better now the next thing we're going to show you is the ability to Output longer forms of text using the gbt 4 model and we go
[15:41] really in depth on this on our AI article generator video so make sure to check that out but we're going to show you a real quick example here essentially what I mean by this is that no matter how high you put your max token usage there are a certain context where when using the GPT 4 model and even when using the GPT 3.5 model it will just stop the output out right in center it it wouldn't give you a full output and what I mean by this is let's say we're using gbt 4 and we're like generate um a 2,000w article it wouldn't be able to do that because it would
[16:11] probably stop you know maybe 600 700 words in so in this context here's what we're going to do we going go ahead and say generate a thw story and then our a article video is going to be a lot more comp comp Lex in this but what'll just do it for this generate a thw story and then we're going to say parameter this is part one okay and then we're going to go ahead and hit continue here let's go
[16:43] ahead and actually change the memory key continue here Test action all right so as you see here we got the output let's go ahead and see how many words that was so I'm going to go over here and copy this so I pasted in here as you see the output reached 430 words so now you're at a conundrum where you're just like okay great but I need this hit a th000 why didn't I hit a th000 let's go ahead and jump back over to zapier here is the really cool trick here and obviously we would need to probably format our user messages a little bit better here but
[17:13] for now just to show you this use case essentially what we can do here is we're going to say um we are generating a story this is part one semicolon and KN the fact that we a th words story and this is basically 500 Words we're just going to go ahead and input the initial story here make sure we find it within the parenthesis we're going to say generate the conclusion of this story and here's what's really cool here we're going to
[17:45] go ahead and upper model to gbt 4 hit continue let's go ahead and test this action so we have the context of part one of the story go ahead and uh generate the other part of the story now you might be saying yourself Corbin didn't you just say we don't want to use a ton of data when we input for gbt 4 models I did say this so you have two options the first option is you maintain it like this you'll be fine it will just be a little bit more expensive your second option is go back to that strategy I showed you before input a 3.5
[18:17] Block in between these blocks summarize this for the main points and then proceed that way choose whichever you prefer and here we go so the end of the part one was in a cavernous room then as you see dot dot dot dot in the cavernous room and it continues a story all the way to the end and so it ended the legend of the inverted Tower and so on really cool stuff if you found what was in this video really cool I implore you to watch our video here where we're looking at the AI article generator
[18:47] where we do a lot of the stuff described here and we put it to work on a real a automation you can start selling to a business but without further Ado let's go ahead and check out our next lesson here where we're going to be looking at zapier blocks and why they're so fundamental for data outputs with chat gbt