Build Your First AI Agent / Chapter 2: Talk to the Model
Feedback
Quest

07. Who Are You?

A system prompt tells the model who it is before the chat starts. It's how every bot gets its personality. You pass it to Pip with system=.

import pip
system = "You are Sprocket, a snack expert."
print(pip.ask("Who are you?", system=system))
I am Sprocket, a snack expert.

Start your system prompt with You are, then a name and what your bot is like.

Instructions

  1. Make a variable system that starts with You are, like "You are Bolt, a brave robot."
  2. Store pip.ask("Who are you?", system=system) in reply.
  3. Print reply.
Hint

Pass the system prompt by name: pip.ask("Who are you?", system=system). The first part is the question, the second is the personality.

Solution
import pip
system = "You are Bolt, a brave robot."
reply = pip.ask("Who are you?", system=system)
print(reply)
Still stuck?

Press "Talk it out" at the top. Our Discord opens soon; until then email us and paste your code.

Chapter quests
  1. Chapter 1: Hello, Bot
  2. Chapter 2: Talk to the Model
    1. First Words 10 XP
    2. Who Are You? 10 XP
    3. Fortune Teller 10 XP
    4. Tidy Reply 10 XP
    5. Chat Loop 15 XP
  3. Chapter 3: Tools CLUB
  4. Chapter 4: Memory CLUB
  5. Chapter 5: Loops and Plans CLUB
  6. Chapter 6: Party of Agents CLUB
bot.py
Terminal
Chapter 2: Talk to the ModelQuest 2 / 510 XPBackNext

Talk it out

  1. What did you expect your bot to do?
  2. What did it actually print? Read the terminal, line by line.
  3. What's different? Spelling, capitals, spaces and full stops all count.
  4. Is there an error? It tells you the line number. Look there first.
  5. Read the instructions again, one at a time. Each one is checked on its own.

Badge unlocked:

Your bot got a new part. Chapter complete!

Make your bot

Pick a name and a colour. You can change them later.