Menu
CoddyTech

Let Code Do the Math

Part of the AI Decisions section of Coddy's AI Prompts journey. Lesson 17 of 22.

The text can be data: an order or a form, sent as JSON. It is tempting to let the AI apply your rules to it. Small models are poor at comparing numbers, though. For this order:

{"order": 1044, "days_since_delivery": 5, "item_used": true, "reason": "does not like the colour"}

Is days_since_delivery more than 30?

yes  █████████████████░░░  83%
no   ███░░░░░░░░░░░░░░░░░  17%

5 is not more than 30, yet the AI leans to yes. Your code gets it right every time: days_since_delivery > 30.

So split the work. Code checks numbers, dates and true or false fields. The AI reads what code cannot: the words a person typed, like the customer's note.

challenge icon

Challenge

Medium

A returns app asks the AI late, a number comparison its code already does. It should read the customer's note instead.

Remove late and add a choice reason that reads the note, with the options damaged, wrong_item and changed_mind, each described.

bugsy Main icon

Start this challenge with Coddy's AI tutor

What is Bugsy?
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in AI Decisions