← Lesson
Descriptions Are Prompts
Joeven
Run
Reset
Python loads on first run
TOOLS = { "get_user": { "when": "Look up a customer by stable user_id. Do not guess ids. Not for email search.", "not_for": ["email", "guess"], }, "search_tickets": { "when": "Search support tickets by words. Read-only.", "not_for": ["refund", "delete"], }, } def pick(question, name): spec = TOOLS[name] q = question.lower() for banned in spec["not_for"]: if banned in q and name == "get_user" and banned == "email": return "skip " + name + " (email is not user_id)" return "consider " + name + ": " + spec["when"] print(pick("user usr_9", "get_user")) print(pick("find user by email ada@x.com", "get_user")) print(pick("tickets about OOM", "search_tickets")) print("docs from registry", sorted(TOOLS.keys())) print("disabled tools are simply absent from TOOLS")
Run to execute this in your browser. Nothing is sent to a server.