< all projects28 steps · medium · Rebuild
Build the tools for a support desk
You will have built five tools for a support desk, one function at a time, and watched a real model work tickets through them: 4 functions that describe the tools, 5 that check the arguments a model sends, 6 that read the ticket system, 5 that change it and are safe to call twice, 4 that turn results and failures into what a model reads, and 4 that put it all behind one kit and a system prompt. Each step is a few lines with its own tests, and the earlier functions are provided to the later ones. The ticket system is handed to you, and so is `model`, with one method, `chat(messages, tools, system, max_tokens)`. It is real: the steps that call it check what it did (it picked the right tool, it fixed a bad id by itself, the refund happened once) and spend a little of your credits. The point of the project is everything around the call. A model reads your descriptions and nothing else. It invents arguments, drops prefixes and repeats itself. What it does when something fails depends on a sentence you wrote. Every part here handles one of those, and each one is tested. When every step has passed, the six files assemble into one kit, and you can hand a real model a ticket, live, and see what changed in the desk.
Part 01 · 4 steps
Describe the tools
What the model is told, and a real model reading it.
Part 02 · 5 steps
Check the arguments
A model can send anything. Catch it before a tool runs.
Part 03 · 6 steps
Tools that read
Wrap the ticket system, and say what to do when an id finds nothing.
Part 04 · 5 steps
Tools that change things
Make a reply and a refund safe to call twice.
Part 05 · 4 steps
What goes back
The blocks a model reads, including when it got something wrong.
Part 06 · 4 steps
The kit
One place that runs every tool, and a real model working tickets.