How To Prompt with OpenAI API For Beginners β
Let's become an AI prompt engineerπ
2024-09-29
Transcript β
[00:00] open AI 01 preview is here and let's see how we can start leveraging it when it comes to prompting an open AI first I'll go over how to even get access to these new models next I'll go over how we actually prompt with these new models and finally what use case these new models even serve in the context of automations software what use case do you serve a one preview what do you serve let's jump in we've got access to new models in the past when it comes to anthropic Google open AI but I'll be honest with y'all 0 preview and 0 mini are honestly extremely impressive in the content of API and accessing Ai and
[00:31] applications and I'm not saying that to exaggerate I mean I'm not paid by open AI y'all like this is just extremely impressive the best way I can put it is this earlier this year we saw the open AI demo when it came to Advanced voice mode you know the voice mode was like no latency where you could literally just talk to Ai and it just talks back like instantly like that level of like Breakthrough occurring to be honest with Y all this is what's kind of incurring here with this new API endpoint 01 mini and 01 preview the amount of value you can get in an output is astonishing comparative to what we've seen in the past with other models 01 preview is
[01:02] like 01 mini on steroids but to be honest with you every single use case I've seen up to the point that I've used personally you can use 01 mini and I really like 01 mini therefore we're going to use 01 mini today I'm going to give you some context of how to even impr prompt with this thing how to access it Etc let's jump in first thing how do we get access Corman I don't have access to this where is this how did you get access to it to find out if you can even get access to it go up to your settings in your settings go to the section called limits and then you will see it right up here usage tier whatever when this first launch it was only available for tier 5 I believe they actually lowered that down to tier four
[01:34] now therefore find the tier that you currently are sitting at and in order to get a higher tier you have to basically spend and use more AI within the open AI platform and I think long-term midterm shortterm they'll lower this tier even lower with these end points so don't worry at a certain point everyone's going to get access to this so now that you know how to get access to it let's understand how we prompt with it first thing you'll notice is that within an 01 mini prompt we have no parameters what do I mean by that we have o1 mini selected if I go to gbt 40 mini look at that we have none of this as the model currently stands we don't have the ability to affect temperature this is how consistent the outputs are maximum
[02:06] tokens the outputs and the inputs the top PE frequency penalty presence penalty we don't we don't have the ability to do anything when it comes to the actual lasering in of the model itself now in the future we'll probably get access to these parameters but to be real with you this model is so good we don't even need them you just need to know how to prompt correctly so second major thing you'll notice is that there isn't system and user instructions here comparative to this where we we have the system instructions here and then we have the user message there let me go and move over y'all I already know I'm going to get that comment Corbin you're in the way I know I know I just moved
[02:37] all right check out this video right here where I go in depth how to leverage system instructions paired with user message as you do want to give different information depending whether it's system instructions or the user message there's actually context here that you need to understand for other models although we need to kind of combine these two in the 01 mini because we don't have system instructions we just have the message therefore let's do a quick prompt together to understand how we would do this where 01 mini shines is when you provide a lot of complex data or a lot of data and ask for complex outputs so let's go and do that together
[03:07] we're going to say based on this and then we're going to use data found with this income and loss sheet I'm going to go ahead and just copy this right here as right now we can't actually do attachments with a mini beta so do this semicolon we going to pry the parenthesis here and then personally I'm going to go ahead jump over here and I'm going to copy all this man see okay so we provided a ton of data here data and now we can get to the prompt therefore the way we're going to structure these prompts is first we're going to provide the major data that
[03:39] we're inputting into the prompt if you're not inputting a lot of data then this doesn't apply but a lot of times when we're doing this workflow through API we're inputting some type of data so whatever the data is put it at the top from here we could just dive in put one sentence then just see a really cool output but if you want to get very specific here let's do that we're to say input format I'm going put Google sheet now in theory input format could be anything format is just giving context of the way we've structured and inputed the data now probably the more important one here is the output format this is very important as this is going to give you the ability to Output from 01
[04:10] however you want it to Output you want to Output it in four paragraphs do you want to Output it in three sentences what do you want to Output Etc so the output format is more specific to the actual structuring of the output format and let me show you something cool here let say Json payload and we will say make it an array we're going to go come back over here save for gross sales every year gross sales every year actually we'll just keep it as a Json payload makeing an array because it's the output format and then we're going to go and say generate the gross sales
[04:41] for every year this can be longer this can be shorter but the idea here is to give you context of how to formalize a prompt input format how is it coming in output format how do you want it to come out and then what do you want generate the gross not the gross gross sales for every year hit run it is thinking and this right here is what makes this extremely powerful let's just go to check it real quick 2027
[05:28] 477565 development and application development is a Json output this is amazing very specific to application development here/ automation development as now we can parse this data reliably for however we want to use it which is extremely powerful I'm going to be doing more work when it comes to ow mini and ow preview and prompting with it more so I'll probably do an updated version of this video later down the line so make sure to subscribe for that I hope you learned something today make sure you leave a like is completely free check out the other prompting video if you want to see how to prompt with other models that have a system instructions and a user instructions as we approach that logic differently without further
[05:59] ado I'll see you in the next video oh we got the Json we got the Json Json output it's an array those are two random videos that's my face the bottom one looks cool I'll see you in the next video