Menu
CoddyTech

Project Overview

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

challenge icon

Challenge

Easy

Over this project you build a triage tool for the support inbox of Pixel Print, an online photo printing shop. It reads the day's tickets, sorts them and reports what the model calls cost. This first step summarizes every ticket.

The input is the number of tickets, then one ticket per line. The starter reads them into tickets and prints the count.

  1. For each ticket, send one user message: Summarize: followed by the ticket. Use model="claude-opus-5-5" and max_tokens=200.
  2. Print #, the ticket's number (starting at 1), a space and the reply text.

For example, for this input:

2
I forgot my password and cannot log in to my account. Please help.
Do you print on canvas? I would like a large print.

the program prints:

Tickets: 2
#1 Summary: I forgot my password and cannot log in to my account.
#2 Summary: Do you print on canvas?

Try it yourself

import coddy_ai as anthropic  # in production: import anthropic

client = anthropic.Anthropic()

count = int(input())
tickets = [input() for _ in range(count)]

print(f"Tickets: {count}")
# For each ticket, ask the model to summarize it and print "#<number> " and the reply

All lessons in Calling Models From Code

Practice on your own: Online Python compiler