Recap: Shop Help Desk
Part of the Calling Models From Code section of Coddy's AI Engineering journey. Lesson 5 of 22.
Challenge
MediumBuild the help desk of Brightside Books. The starter reads the customer's name and their question; SHOP_FACTS holds the shop's facts.
- Write the system prompt:
You are Juno, the help desk of Brightside Books., a space,SHOP_FACTS, a space andEnd every reply with "Happy reading!" - Send three messages: the user says
My name is <name>., the assistant repliesHello <name>, how can I help?, then the user asks the question. Usemodel="claude-opus-5-5"andmax_tokens=200. - Print
Answer:and the text of the text block (find it by its type). - Print
Stop:and the stop reason. - Print
Tokens: <input> in, <output> out.
For example, for the input Lena and When does the shop open? the program prints:
Answer: The shop opens at 10 am and closes at 7 pm. Happy reading!
Stop: end_turn
Tokens: 97 in, 16 outTry it yourself
import coddy_ai as anthropic # in production: import anthropic
client = anthropic.Anthropic()
SHOP_FACTS = (
"The shop opens at 10 am and closes at 7 pm. "
"Delivery is free on orders over 30 dollars. "
"Gift cards never expire. "
"Returns are accepted within 14 days with a receipt."
)
name = input()
question = input()
# Write your code below
All lessons in Calling Models From Code
1First Model Calls
Your First Model CallMessages and RolesSystem PromptsReading the ResponseRecap: Shop Help DeskPractice on your own: Online Python compiler