ChatGPT AI: Yes Minister! (Difficulty: 3)
-
Introduction
Now you should know how to build a chat-based project using ChatGPT. One of the key skills is to write great prompts so that ChatGPT will behave as you expect.
In this tutorial, you will practice composing a new prompt, which will make ChatGPT play a role-playing game with the user. The game is called “Yes Minister!”. In the game, the user pretends to be the Prime Minister of the United Kingdom and makes many important decisions.
Step 1 - Create a Starting Project
We will use the project from the previous tutorial as the starting point. If you don’t have it, you can follow that tutorial to build one, or remix the following project:
https://play.creaticode.com/projects/1d035cd905c5a5c4f878f48a
Step 2 - Describe the Scenario
Now let’s go directly into writing the prompt. The goal is to make sure ChatGPT “understands” who the user is and what it is expected to do at a high level. We will still use the comment box to write up the prompt. You can clear any existing words in the comment and add the following sentences:
You will play a role-playing game. The user is a 6th-grade student. Pretend the user is the Prime Minister of the United Kingdom, and the time is January 1st, 2030.
Your editor should look like this:
Step 3 - Describe the Game Format
Next, we need to tell ChatGPT exactly how the game plays: what it is supposed to do, and what the user is supposed to do. We can add the following description:
Game format: you ask the user to make a decision among a few options. The user will make a choice, then you ask the next question.
Step 4 - Ask the user to start the game
Lastly, we need to make ChatGPT to wait for the user to start the game. We can add this line to the end of the prompt:
Now ask if the user is ready to start.
Step 5 - Copy the Prompt
Now we are ready to actually try this prompt. Copy the entire content of the comment box, select the input of the “system request” block, paste the prompt, and then press ENTER or TAB to confirm.
Step 6 - Display an initial message
Now we still need to ask the user if he or she is ready to start. We just need to add this sentence to the beginning of the chat:
You can use the robot icon for the AI this time, and feel free to pick a new color for the message.Now if you run the program, it looks like this:
Step 7 - Improve the questions
Although our game is already playable, we can improve the questions in a few aspects.
First, the questions seem a bit too long. We can make ChatGPT more concise.
Second, currently we may get questions that are not related to previous questions. To make the user’s decisions count, ChatGPT should ask questions based on the user’s decisions.
We can address both issues with the following new paragraph in the prompt:
Keep the descriptions clear and concise. Make sure all your questions are directly related, and different user choices would lead to very different follow-up questions.
Add the new paragraph to the comment box like this:
Copy the whole prompt into the system request block, then run the project again. You might get a conversation like this:
The description is more concise, and the follow-up questions are directly based off the earlier choices.
Step 8 - Say “Yes Minister!”
To make the game fun, we can even ask ChatGPT to always start its response with “Yes Minister!”. Add the following sentence to the prompt, then copy it again to the input box:
Now let’s test it again:
It turns out the first response we get started with “Yes Minister!”, but the second time it changes to “Great choice, Minister!”. This is most likely because ChatGPT tries to vary its response to sound more human. This is still acceptable, so we can keep it like this.
Step 9 - Game Scores
To make the game complete, it is important to give the player a goal to achieve. In this case, let’s ask ChatGPT to evaluate our player and give a score:
After the user makes exactly 3 choices, evaluate how well the user did and generate a score between 1 and 100.
Now we will get a score after making 3 choices:
Creative Ideas
In this tutorial, you practiced how to design and improve your prompt to make ChatGPT respond in a certain way. Here are some ideas for you to practice more:
- Bad Choices: to make the game fun, you can try to ask ChatGPT to add some awful choices in each question, so if the player is not thoughtful, he or she may get a really low score.
- Choice List: sometimes, ChatGPT would format the questions as open-ended. You can try to force ChatGPT to always list the options as A), B), C), etc.
- Limit the Policy Scope: you can further limit the questions to a certain area of interest, such as education policy, foreign policy, etc.
- Other Leaders: it should be fairly easy to change the user’s role to some other leaders, such as the CEO of a company or the principal of a school.
-
-
How did you start your journey as being the Prime Minister. Why did you decide to go on that journey and what made you decide you wanted to?