Calculators
Draws a calculator card in the Agent UI and the TUI. The card does the
arithmetic and recomputes as the user changes the numbers, so a wrong sum from
the model never reaches the answer.
Procedure
- Pick the calculator.
- Tipping or splitting a bill →
calculators/show_tip_calculator(bill, tip percent, people). - A mortgage, car loan, monthly payment or loan interest →
calculators/show_loan_calculator(price, yearly rate in percent, years, down payment).
- Tipping or splitting a bill →
- Pass the numbers the user gave, as they gave them. Send the full price as
priceand the part paid up front asdown_payment; never subtract one from the other. Use defaults for what the user left out (18% tip, one person, no down payment). - Set
currencyfrom the money in this request: "$" isUSD, "€" isEUR, "£" isGBP. - If the call returns
"ok": false, fix what itserrornames and call the same tool again. - After the card is shown, reply with one or two short sentences. Do not do the math in text or state the results: the card shows them.