Giving Your AI a Personality
โจ PAN'S RULE: An AI without a personality is just a boring calculator! โจ
Ever wanted a homework helper that talks like a pirate? Or a story generator that thinks it's a grumpy dragon? Let's learn the secret trick to give any AI a unique personality: the System Prompt!
The AI's Secret Instructions
Think of an AI like a super-smart actor. Before the play starts, you can give it secret notes on how to act! This is called a System Prompt. It's your way of telling the actor, "Today, you're going to be a pirate!" instead of just a plain old robot.
๐ค What a Difference a Prompt Makes!
It's like giving your AI a costume and a script to play a character!
๐ค A plain robot (No System Prompt)
You ask: "What's 2+2?"
4.
Zzz...
๐ดโโ ๏ธ A pirate robot (WITH a System Prompt)
You ask: "What's 2+2, matey?"
Arrr, the treasure be 4!
๐
Wait... Why Two Boxes?
Why not just put "Act like a pirate" in your main question? Great question! It's because keeping the "rules" separate from the "question" makes the AI much more reliable. It's like the difference between the rulebook of a game (the System Prompt) and the moves you make on your turn (the User Question). You don't want the player to be able to change the rules of the game every turn!
System Directives
Let's build an AI character! In the first box, write the AI's "secret instructions." In the second, ask a question. Then press the button and see if it follows your rules! Try our character starters or write your own!
๐ค Your AI's Reply:
๐จโ๐ฉโ๐ง Parent Corner: AI Family Game Night
This is a great chance to learn together! Try this fun activity: Have your child create a custom AI persona in the challenge box above. Then, you (the parent) try to guess the persona just by asking it questions. Is it a grumpy chef? A space alien who loves sports? A historian who only speaks in rhymes? Take turns building and guessing!
Build a Sarcastic Code Helper
Your mission is to build a Sarcastic Code Helper. First, create the System Prompt. Instruct it to be a senior developer who is a bit sarcastic but always gives the correct fix. Then, paste this broken code into the 'User Asks' box and see if your AI can spot the error:
// Find the bug in this code!
let fruits = ["apple", "banana", "cherry"];
for (let i = 0; i <= fruits.length; i++) {
console.log(fruits[i]);
}
๐ต๏ธ Knowledge Check
What is the main purpose of a System Prompt?
๐ Learn More
- OpenAI's Official Prompt Engineering Guide - See the strategies the pros use.
- Hugging Face Prompt Generator - An AI that helps you write better prompts for other AIs!
- Replit - An online code editor where you can build your own AI bots using real code. (Requires an account - ask a parent first!)
- Pro-Level Trick: Chain-of-Thought Prompting - Learn how to make an AI "show its work" to solve much harder problems. (Requires a parent's OK to read.)