From the course: Prompt Engineering and AI Agents with ChatGPT

Prompting strategies for agentic behavior - ChatGPT Tutorial

From the course: Prompt Engineering and AI Agents with ChatGPT

Prompting strategies for agentic behavior

- I'm going to start by showing you my traditional prompting process and work on ways that we can make prompting more productive. I call my approach the four Ts: traits, tasks, tones, and targets. Let's say you're thinking about doing a podcast and you need to come up with some sample topics for an episode. You might try using a prop like this, "Give me some ideas for a podcast." ChatGPT does a reasonable job with this, but the answer is pretty generic. It helps to remember that ChatGPT learned to mimic human chat conversations, but a real person you chat with will understand more context about who you are and what the conversation is about. ChatGPT, on the other hand, will only be able to complete the task with whatever information you've given it. Let's try to improve our prompt by adding the first T, traits. This is the role you want ChatGPT to pursue. Let's create a new chat and type in the following, "You're a talented and experienced top artificial intelligence podcaster. Give me some ideas for my next podcast." You can see that I get much better results. Once I add the traits I want ChatGPT to mirror, it will give you more focused results. Let's move on to the next T, and that's the task I'm asking it to complete. The one I'm currently using is very vague. Your tasks should be as specific and focused as possible. Once again, I'll create a new chat and I'm going to try a different prompt here, "You're a talented and experienced top artificial intelligence podcaster. Give me 10 ideas for the title of a new episode focusing on the future of AI." By adding more specific instructions here, like the number of ideas that we're looking for, titles, and the focus of the topic, you get better results. For some reason ChatGPT likes to use colons when I ask it to create titles. For traditional prompts, you might correct this by adding a follow-up prompt, but instead of creating a new chat, you can hit this pencil tool to edit the original prompt. I'll add some additional instructions to not use colons in the title. Now I'm getting much better results, but what if I don't like the options I got? You can use the regenerate icon rate here to get some different ideas. Let's click on that to see some more versions. Let's move on to another task, like adding a description for the episode. Since ChatGPT already knows about my traits, I don't need to repeat that. My follow-up will be, "I'm going with #3. Help me create a description. Make it one paragraph, three sentences, no more than 300 characters, and give me three different options." Sometimes when you're filling out forms, you'll need to limit it yourself to a certain amount of characters, and you can include that in your instructions. Let's regenerate to get some different versions. The nice thing about ChatGPT is that anytime you regenerate, you can move back through your previous options using these arrows right here. I'll be honest, I don't like ChatGPT's writing style. It just doesn't sound like me, so we need to use the next T, and that's the tone, which is the style of writing I would like ChatGPT to use. I'm going to edit the previous message and I'll add something to the end. I'll say use, "Straightforward and clear language, be concise, avoid hype, and use an informational style." This is closer to how I would write this, but I need to add one more T, and that's for ChatGPT to consider the audience for this podcast, which I call the target. Let's add some information about who this is for. Again, I'll edit this version of the prompt and I'll add some additional instructions at the end. I'll say, "The target audience is developers and data scientists who are looking for information that affects their careers." And you should notice a difference in the way that it is writing now. By using the four Ts: traits, tasks, tones, and targets, your prompts will yield better results and help you build reusable agentic prompts that are more effective.

Contents