← Lesson
When Not to Use an LLM
Joeven
Run
Reset
Python loads on first run
def use_llm(ticket): text = ticket["text"].lower() if ticket.get("job_id") and "status" in text: return "tool get_job, no llm" if ticket.get("amount") is not None and "refund" in text: return "workflow refund, no llm" if "how do i" in text or "explain" in text: return "llm draft, then human" return "llm classify, then route" tickets = [ {"text": "status of job", "job_id": 17}, {"text": "refund please", "amount": 12.5}, {"text": "how do I reset MFA?"}, {"text": "this invoice looks weird and also the VPN"}, ] for t in tickets: print(t["text"], "->", use_llm(t))
Run to execute this in your browser. Nothing is sent to a server.