Skip to main content

Mastering the Art of Crafting Effective Prompts

Lesson 5 from: Getting Started with AI Prompt Engineering

Mark Hinkle

Mastering the Art of Crafting Effective Prompts

Lesson 5 from: Getting Started with AI Prompt Engineering

Mark Hinkle

buy this class

$00

$00
Sale Ends Soon!

starting under

$13/month*

Unlock this classplus 2200+ more >

Lesson Info

5. Mastering the Art of Crafting Effective Prompts

Students will learn the nuances of creating precise and impactful prompts for AI systems. Through this lesson, learners will acquire the skills to design prompts that elicit desired responses, ensuring optimal outcomes from AI models like ChatGPT.

Lesson Info

Mastering the Art of Crafting Effective Prompts

1 Rather than a whole bunch of individual prompts, 2 what we're gonna do now is create a complex prompt 3 that allows you to complete something complicated. 4 So, in this case, I'm gonna complete a report, 5 and it's actually gonna be a business plan. 6 It could be any kind of plan. 7 It could be a sales report, 8 it could be a story, it could be a book. 9 But I typically start with all the pieces, 10 the system prompts, to generate a larger work. 11 So, let's start with a role, 12 and the role for this business plan 13 is a business consultant. 14 And I'm gonna ask it to follow the methodologies 15 of McKinsey & Company. 16 And McKinsey & Company is a big, well-known consulting firm. 17 The next step is to define the outcome. 18 So my company is called Peripity Labs, so I want it 19 to reference Peripity Labs. 20 I want a complete business plan, 21 and I want that consultancy 22 to offer management consulting services and training. 23 I'm gonna define the tone. 24 I could sa...

y as an expert, 25 but I know that it's scoured the internet 26 and it knows that Harvard Business School is... 27 Has a certain case study format, a certain tone. 28 So I've referenced that. 29 I also gave it some more information, 30 and what my core competency is, 31 in marketing and business process management, emerging tech, 32 including artificial intelligence. 33 And then I also told it about 34 the length of the business plan. 35 So the length of the business plan, 36 I've given it in tokens, 37 because it does understand what tokens are. 38 Words can be somewhat ambiguous 39 because words have different lengths. 40 So 200 or 2,500 tokens gives it a more consistent length 41 than 2,500 words. 42 Then let's do an example. 43 So in the past, we had seen the few shot 44 where we gave it some examples. 45 I actually gave it an example of a business plan, 46 and I put that into my prompt and we'll see that later. 47 I also decided to use plugins to help inform the model. 48 And this is also part of the few shot prompting is 49 I'm gonna add two links that reference business plans 50 on the web and it'll use web pilot or link reader 51 or one of my other plugins to go get that information. 52 That's where we're gonna stop right now. 53 I have this prompt, and we're gonna see what it does. 54 So I'm gonna go back to my prompt library, 55 open it. 56 And notice, I have these headings here. 57 It probably is not the best practice 58 to cut and paste the headings. 59 It will use up some of the tokens if you were using 60 a AI that measures tokens. 61 But it makes it much easier for me to organize my thoughts. 62 So I'm gonna use that as is. 63 I'm gonna go to GPT-4. 64 I'm gonna take all the elements of the prompt I just had. 65 I'm gonna paste it in. 66 At the end, you'll notice that I said, "Do you understand?" 67 What that's gonna do is it's gonna actually echo back 68 what it's supposed to do. 69 And while it runs, it's gonna say, 70 "Yes, I will create a business plan for Peripity Labs." 71 It's gonna iterate the fact that it'll be in the tone 72 of Harvard Business School and it'll be 2,500 tokens long. 73 And there, it's actually going 74 and retrieving some stuff using web pilot. 75 Because it has the new features in ChatGPT, 76 sometimes you may see JSON, J-S-O-N code pop up in there. 77 It's really talking about 78 how it's making the query of the plugins. 79 It's probably not the most user friendly 80 for a non-technical user, but that's how it works today. 81 Now notice that you don't see it spinning. 82 And this happens so many times. 83 So I'm gonna just hit continue. 84 And it's sort of probably just timed out using web pilot. 85 And now you see this web pilot status spinning, 86 and that's because it's making the query 87 for some of the things that I've listed in there. 88 And if you go back up here, 89 you can see that these are the two examples 90 I wanted it to pull from the web, and that's probably 91 what it's grabbing right there. 92 You can actually expand that 93 and you can see that web request right there. 94 And the response, which is a bunch of text. 95 You probably will not need to do that, 96 but if you're curious and you wanna see how things work, 97 that's what's going on in the background 98 is it's making a request to web servers 99 to inform GPT-4 and ChatGPT of these external links. 100 Now it's generating some information 101 and it's actually not creating the plan, 102 but it's done the query of one of those business plans. 103 And it's given me summary. 104 And it says, "Would you like more detailed information 105 on any of these steps?" 106 So it got derailed. 107 This isn't a fault of the prompt, 108 this is just the way that the AI interacted. 109 So what we'll do is, please write the business plan 110 (keyboard clicking) 111 I requested. 112 And we'll send it on its way. 113 And here it's doing that. 114 So think about this as your scatterbrained friend 115 who can't keep their thoughts on one thing at a time. 116 What I just did was redirect the AI 117 back to the task at hand. 118 It also provided references, which is good 119 'cause I wanna be able to reference how it did this. 120 And it said that the methodology was McKinsey & Company 121 and the style of Harvard Business School. 122 That's additional information, 123 but say it's not quite complete. 124 Say I wanna add something to it. 125 This is pretty cursory and I made it pretty cursory 126 for the purposes of this demo. 127 But say I wanted to add to my plan and said, 128 "Part of my plan is in the marketing 129 and sales strategy, I wanted to 130 list my services on Fiverr Pro. 131 And Fiverr Pro is an elite marketplace for services, 132 the highest quality, and it connects freelancers 133 with businesses looking to hire, 134 and it requires application. 135 So I'm telling it that let's do that, is 136 I could just type it in, and it might figure it out, 137 but let's add this as part of 138 our sales and marketing strategy. 139 And because there's a link in there, 140 it's once again gonna call the web pilot plugin 141 to pull that information from the Fiverr website. 142 So that's gonna take a little bit. 143 Notice right here, it's telling me what it pulled 144 from the site, then it pulls up 145 the part of the business plan for sales and marketing. 146 And through sales, it now includes Fiverr Pro. 147 Now notice that it did all that and it created a link. 148 And this is something that's been happening 149 to me more often, is that the output, when it has a link, 150 creates some, let's just call it funky formatting. 151 What I can do is ask it to rewrite the whole plan 152 with these changes. 153 And what it'll do is it'll re-output it. 154 So sometimes this is good if you need to cut and paste, 155 but sometimes it does take up more cycles. 156 And technically, it could vary the original results. 157 So it's up to you to try with your level of comfort. 158 But we're gonna just let it go through, 159 reprint this whole thing. 160 So if I wanted to cut and paste this into a Word document 161 or edit it somewhere else, I could do so. 162 That's how you create a complex prompt. 163 And we'll go back and we'll just do a little bit 164 of recap for you. 165 We started out, we had a role, 166 we defined the end result. 167 We provided an example. 168 We provided additional examples using plugin. 169 And then we ask it to explain its reasoning. 170 A lot of times when you explain its reasoning, 171 it provides a more thoughtful answer to you. 172 And these are all applying human terms 173 to something that is just a machine 174 that's using probabilities. 175 But if you provide that, ask it to provide reasoning, 176 a lot of times you get a better result. 177 So that's how you create a complex prompt.

Class Materials

CLASS MATERIALS

Super Prompts

Ratings and Reviews

Mayoon Boonyarat
 

It's a really good starting point and gives you an overview. The CreativeLive team is really fantastic to bring Mark here. You'll know that the most important skill is the prompt skill. Talk with AI.

Student Work

RELATED ARTICLES

RELATED ARTICLES