Menu
CoddyTech

Recap: Shop Help Desk

Part of the Calling Models From Code section of Coddy's AI Engineering journey. Lesson 5 of 22.

challenge icon

Challenge

Medium

Build the help desk of Brightside Books. The starter reads the customer's name and their question; SHOP_FACTS holds the shop's facts.

  1. Write the system prompt: You are Juno, the help desk of Brightside Books., a space, SHOP_FACTS, a space and End every reply with "Happy reading!"
  2. Send three messages: the user says My name is <name>., the assistant replies Hello <name>, how can I help?, then the user asks the question. Use model="claude-opus-5-5" and max_tokens=200.
  3. Print Answer: and the text of the text block (find it by its type).
  4. Print Stop: and the stop reason.
  5. 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 out

Try 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

Practice on your own: Online Python compiler