← Lesson
Agents vs Chatbots vs Workflows
Joeven
Run
Reset
Python loads on first run
def workflow(ticket): # Step 1: classify (in production this can be an LLM call) kind = "billing" if "invoice" in ticket.lower() else "tech" # Step 2: retrieve docs = { "billing": ["Refunds take 5-7 days", "Invoices are in /billing"], "tech": ["Restart the agent runner", "Check API_KEY"], }[kind] # Step 3: answer return {"kind": kind, "answer": docs[0], "sources": docs} print("invoice ticket:", workflow("My invoice is wrong")) print("runner ticket:", workflow("The runner crashed")) print("mixed ticket:", workflow("Where is last month invoice after the runner crashed"))
Run to execute this in your browser. Nothing is sent to a server.