Pack 2 · Challenge 5 of 5 · 10 XP · ⏱ 7 min
Name Keeper
🧾 Last rep: a two-message chat where Pip has to remember your name. Every message goes into the history, Pip's replies too.
messages = [{"role": "user", "content": "Hi!"}]
reply = pip.chat(messages)
messages.append({"role": "assistant", "content": reply})Instructions
- Start
messageswith the user sayingMy name is Zara. - Print
pip.chat(messages)and add Pip's reply tomessagesas the assistant. - Add the user asking
What is my name?, then printpip.chat(messages).
💡 Hint
Three appends in total: user, assistant, user. Print after the first pip.chat and after the second.
bot.py
Terminal