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

06. First Words

An AI agent starts with a model: something you send words to and get words back from. Meet Pip, our tiny practice model. Pip runs right here in your browser and always gives the same answer to the same message, so your tests always work.

import pip
answer = pip.ask("Hey Pip!")
print(answer)
Hello! I am Pip, a tiny practice model. Ask me something.

pip.ask() takes your message (the prompt) and gives back Pip's reply as text. Real models work the same way. They're just bigger.

Instructions

  1. Start with import pip.
  2. Store pip.ask("Hello!") in a variable called reply.
  3. Print reply.
Hint

import pip, then reply = pip.ask("Hello!"), then print(reply).

Solution
import pip
reply = pip.ask("Hello!")
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 1 / 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.