from signalwire import AgentBase
agent = AgentBase(name="my-agent", route="/agent")
contexts = agent.define_contexts()
ctx = contexts.add_context("default")
ctx.add_step("greet").set_text("Welcome the caller.")
step = ctx.add_step("transfer")
step.set_text("Transfer the caller to the appropriate department.")
step.set_valid_contexts(["billing", "support"])
billing = contexts.add_context("billing")
billing.add_step("invoice").set_text("Help with billing inquiries.")
support = contexts.add_context("support")
support.add_step("help").set_text("Help with support issues.")
agent.serve()