Complete OpenAI's API ChatGPT Tutorial - [Become A Prompt Engineer in 15 Minutes]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
when building out artificial intelligence integrated software a very very important skill to have is the ability to know how to set up the prompts right now the education around prompt engineering and the ability to access AI through API for our softwares is limited so that is why I'm making today's video as I want to show you how to actually create your prompts when using it through software here's something to keep in mind y'all the way we structure our prompts when it comes to accessing it through API and the software we create is entirely different than how we will create a promps for chat gbt in the front end or alternatively accessing Chad gbt through automation softwares like zapier and make so in this video we're going to learn how to actually prompt engineer for API welcome back y'all in today's video I got this idea from one of the replies I got on a recent post that I did on Twitter or X basically saying how do you make changes to your prompts do you need to redeploy your app every time so I'm actually going to go go ahead and show you my workflow on how I create AI prompts for the software I'm currently creating if you don't know what that is as now it's called tube stamp plan on changing that name so you may not you may see a different name in my Twitter profile by the time you see this who knows I've been at this for the last seven months and I've been using prompts for the last year and a half so you're going to get all of that data compressed to this nice little short video so you understand how we can start creating these prompts in our software understanding how to create AI prompts in software is basically anytime you hear an article talking about prompt engineer gets paid XYZ big skill monetize prompt engineering this is where the money's at creating prompts in software is the most valuable skill asset you can have in the next coming years due to the New Market we're about to emerge I can almost guarantee you that in the future I will be paid and other people will be paid just for the service of creating prompts in software because it's absolutely important to understand how to do it so let's go ahead and learn how to do it so the way I approach this is two major ways first way is we're going to go ahead and leverage playground within open AI dashboard here we're going to go ahead and select chat chat's going to allow us to get relatively similar outputs that we would expect to see in our software so we're going to go ahead and first uh adjust some of these settings on the right so you can get context of how a prompt would look like in software when we're coding it it could possibly look like this now we are transitioning a lot of the backend as now to python this is more of a node.js type of function here we do a couple things first thing is we pass data through to our prompt now in this context the prompt is going to be the content this is how we're referencing data and then this is how we're referencing the open AI key in the headers of this logic now the reason now some of y'all that used this API is like why did you structure it like this the reason I structured it like this and not traditionally with the completions call in a different format for node.js is because of the fact that I needed to get the xrate limit header which is basically how many tokens are available per minute as of now we're switching to python we're using uh the other logic of exponential back off which it's a lot better let's go learn different variables we'll use in our prompt so the first one's going to be Max tokens and temperature those are going to be the two major ones we're going to use in our prompt right away Max tokens you're looking to set this around 500 to 1,000 depending on your use case I think these are safe numbers if you need to do more do more this is basically telling gbt how many words it's allowed to output and this can basically vary on how big the output is for your underlying message next is temperature this my friends is probably one of the most important things in prompt engineering and if you are a company yourself and you want to gut check an engineer that could possibly be working in your backend this is how you gut check them basically you're going to ask something along the lines of other than Max tokens what other additional variable do you set in order to ensure scalable outputs EG if this runs a thousand times every single time it goes out the output is consistent that's actually the name of the game when it comes to prompting for AI in soft software as user one and user 1000 should have the exact if not the exact output to an extent in structuring and formatting knowing that we have two different ways of structuring this either through temperature or tap PE those are the two main variables personally I like using temperature temperature if I can go Ahad and find the reference to it here we go so temperature is basically what sampling temperature to use between zero and two higher values like 08 will make the output more random and lower values will make it more focused and deterministic if we're dealing with software and we're dealing with thousands of users we got to make it deterministic we got to make sure that every single output is similar so that some uh like you know user 967 doesn't get like a crazy output because their temperature is too high so I like to lower this low we're going all the way down to 0.1 we set up parameters we understand that we're doing 0.1 we'll do maximum length or tokens in this context we'll go up to 500 in today's video I'm going to do a real quick example of how we could possibly structure this the V the example for today is going to be assuming we're using uh we're receiving an email and in that email I'm going to just do like a simple prompt and show you kind of structuring of how we structure the prompts for an output that basically responds to that email if I was doing this in code basically I would probably put in subject line do subject then we would do comma body comma open AI key and then this would be you know put the subject here the body here this is how we' reference it in the prompt but because we're using the playground we care about we don't need all this extra information you can delete this and basically just start messing with the prompt itself let's go and begin so to show you an example prompt I'm actually going to show you the one we use in our software nah I'm just joking that's too that's too valuable come on y'all you really think I was going to do that come on y'all all right so this one basically this is how you want to do it we're going to start with a please we're going to go H shift enter to guidelines to formatting and then we'll do s one here shift enter enter and put email subject so go in and we'll do email body I like typically having the data like the big piece of data that's being internalized at the end of a prompt as you saw before if this was the code logic we make sure we add our data points like that because we're not using Code logic right now I'm going put in fix variables here just because I'm purely doing it for testing reasons right I'm just seeing if we had this data come through this prompt how would it look so I'm going input this fake data data we're playing with here is going to be a fake partnership email so we got this one we got the subject line we got the dear James everything of this nature now the question you might be having us like okay well how do we parse the data so it comes in like this this is going to be other logic within your software that basically uses either Json or something of that nature where parses the subject line of the data point that's receiv received through the API call gets the body that's basically we're dealing with the prompt now we're assuming that the data is coming the data that is coming into the prompt is as clean as possible remove any special characters remove any extraneous stuff that isn't necessary this is a data game y'all the less data we put in our prompt the better it will perform and also the cheaper it will be formed to give context if we're going to go between gbt 4 Turbo to accomplish a job compared to gbt 3.5 we are talking about very very large margins very specific detail from our current software is that if we had the same value Point output through gbt 4 it's going to cost us around 27 cents that same logic if we did it through 3.5 would only cost us around 4 cents so we're talking hundreds of perent depending on the model you choose so in this video we're going to go gbt for Turbo preview we're actually gbt for 0125 and as a side note real quick you might be saying what the heck do these numbers stand for 0125 January 25th 0613 June 13 0301 March 1st this is 2023 of course knowing this you're always going to want to go with probably the most recent endpoint model because even if your prompt performs better in let's say gbt 6133 these are deprecated endpoints these are deprecated ways to model interacts with data therefore even if your prompts actually perform better with older versions of the model you're going to have to just update your prompts part of the game so you're going to have to go to gb4 Turbo or gbt 40125 to stay up to date with the new endpoints as these models are constantly improving from my experience up to this point of 7even months of development I have noticed that even with these new endpoints it isn't like holy smokes I got to completely change my prompt slight tweaks and on top of that I have noticed that the outputs that I'm requesting actually are higher quality so overall it's a good thing it's a good thing that's improving and it's also a great caveat that basically as these models improve so do your software Perfect all right so we're going to go ahead and start with the output we're looking for we're say please generate a response to this email and we're going go and just do this and then guidelines of formatting here is what I like to do this is where we're going to basically ensure consistent outputs so how do we want this data to look when we receive it so to do so we're going to go ahead and start with length Max of four sentences then want to go go ahead and say Stone professional these can get comp complex you can do whole sentences here but this is like a really good way to organize your prompts at least with API tone let's say aim awareness reference the person's name who is reaching out if it's in the email body notice how I'm referencing data that's inputed through the actual name so this is kind of like emo body email body obviously in the actual code it would be these brackets right but this is important it's not straight up coding of course because we're still using lay IND dictation but we are referencing you know future things or future data points that's within the prompt with the actual name itself so EMA body emo body this is important this is this ensures consistency so let's go ahead and see what we get with this output so far from the guidelines I formatted here please gener email response we hit submit so here we go we got subject evaluate your event with bark and bite let's partner dear Sam thank you for reaching out and considering a partnership with receiving a company event I am intrigued by the opportunity notice how it does grab Sam here have the opportunity with bark and bite to create an engaging and memorable experience for our dog loving attendees as regards James notice how there's a couple things in here I don't want I don't want a subject line I don't want this recipient like this like variable that isn't really put so we're just going to go ahead and update this and what's important for you to understand is when we update this I need to exit this out think of this like if you're familiar with my zapier tutorials refreshing the memory key as if I hit submit again it would have used that previous output as context and basically just mess up the whole process side note also noticed in that tweet said do you redeploy every single time you do logic when these AI promps in it changes I'll first put it through the ringer in playground once I get satisfied and confident that I really like what it's doing like 90% then I'll put it into my function then I'll redeploy in a staging environment of course and see what I can do in that realm that right there you'll notice a plus or minus 10% difference on the outputs why that incurs between playground and the actual softare calling it within that logic I have no clue that's why you have to make sure that you are very specific in these prompts and get them as specific as possible okay so we're going to add another Dash here we're going to say no subject line in output another Dash here we're going to say use no variables in output perfect let's go ahead and minus that hit submit here and see what it comes up with there we go y'all we got dear Sam no subject line paragraph best regards Jame and at scale we can expect no subject lines we can expect no variables in the output and proceed in this manner and the reason I'm so confident in that is because of the fact that as you see over there we set our temperature to 0.1 which basically tells the API hey don't mess around don't get creative on me this isn't funh house you're not supposed to be drown of crayons be consistent if you like today's video make sure to leave a like it's completely free subscribe if you haven't already as basically this is probably the most modern upto-date information when it comes to actually creating AI software and lastly because I know I've been asked this a lot and I see your comments and I try to respond yes in the future I will be creating a fully indepth how to create an AI software from zero lines of code to let's say 20,000 lines of code whatever it may be and actually show the code and actually show the logic but to be completely transparent with y'all because that's part of the name of the game of this channel I'm not doing it yet and I'm not doing it yet for two major reasons first major reason is like I'm in the process of creating my own software and that's pretty heavy on my day and basically I want to get the full life cycle of that software not in the sense of like three years from now but in the sense of like hey this is what happened from day dot to day 1,000 users so when I build out this playlist you'll get all that knowledge put into it and you'll be like okay well at least I can watch this guy and realize that like he really did go from date like zero lines of code to a thousand active monthly subscribed users and that would be a really really beneficial video or playlist the second major reason of why I'm not doing it yet is because it's pretty Niche this would probably Niche me down too much at the point of where I'm at in content creation this is kind of like a business decision where I'm sitting at 30,000 subscribers if I went down the rabbit hole and did do this entire playlist of coding this would basically cause a lot of the subscribers on my channel to be like yo this is too much y'all I'm leaving so that's why as of know but trust me it's coming I want to do it because I think it'd be a ton of fun plus no one in this space has actually done a playlist like that that's actual value it's all just GB oh yeah creative sass not code tool now if you know why that's a bad idea you can check out that video but I'll see you in the next video that playlist right there goes over from concept to software you're going to learn a bunch of stuff when it comes to creating software such as understanding how to access API at scale software ideas if you want some ideas that's a random video that's my face I'll see you in the next video
Info
Channel: Corbin Brown
Views: 13,381
Rating: undefined out of 5
Keywords: chatgpt, zapier, openai, ai automation, gpt tutorials, chatgpt education, ai automation agency, ai for business, ai service, zapier tutorials, software business, entrepreneur, start a business
Id: NiQ_9xwS4v8
Channel Id: undefined
Length: 14min 22sec (862 seconds)
Published: Tue Feb 13 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.