Skip to content

< 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.

Start: Describe one argumentSign in to run steps and keep your progress.
  1. Part 01 · 4 steps

    Describe the tools

    What the model is told, and a real model reading it.

    1. 01Describe one argumentnext
    2. 02An argument with a few allowed values
    3. 03One tool's spec
    4. 04Describe the five tools
  2. Part 02 · 5 steps

    Check the arguments

    A model can send anything. Catch it before a tool runs.

    1. 05Is this value that kind?
    2. 06What did it leave out?
    3. 07What did it make up?
    4. 08What did it get wrong?
    5. 09All of it at once
  3. Part 03 · 6 steps

    Tools that read

    Wrap the ticket system, and say what to do when an id finds nothing.

    1. 10Keep long text out of the conversation
    2. 11When an id finds nothing
    3. 12Read a ticket
    4. 13Stop on time
    5. 14Find a customer's tickets
    6. 15Read an order
  4. Part 04 · 5 steps

    Tools that change things

    Make a reply and a refund safe to call twice.

    1. 16Reply once
    2. 17Name the refund
    3. 18The rules, in code
    4. 19Is it their order?
    5. 20A refund that cannot pay twice
  5. Part 05 · 4 steps

    What goes back

    The blocks a model reads, including when it got something wrong.

    1. 21A tool result
    2. 22A failed result
    3. 23Tell the model how to call it
    4. 24A tool that does not exist
  6. Part 06 · 4 steps

    The kit

    One place that runs every tool, and a real model working tickets.

    1. 25Put the tools in one place
    2. 26Run a tool, whatever the model sent
    3. 27Answer a whole turn
    4. 28Put it to work