← Lesson
Model vs Runtime
Joeven
Run
Reset
Python loads on first run
LOG = [] def refund(invoice_id): LOG.append({"tool": "refund", "invoice_id": invoice_id}) return {"ok": True, "invoice_id": invoice_id} def ui_status(assistant_text, ran): if ran: return "Refund sent (from log)" if "refund" in assistant_text.lower(): return "Assistant claimed a refund — not in the log" return "No refund" print(ui_status("I have refunded INV-17.", ran=False)) print("log empty", LOG) print(refund("INV-17")) print(ui_status("Done.", ran=True)) print("log", LOG)
Run to execute this in your browser. Nothing is sent to a server.