remove_step

View as MarkdownOpen in Claude

Remove a step from this context entirely.

Parameters

name
strRequired

Name of the step to remove.

Returns

Context — Self for method chaining.

Example

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("Greet the caller.")
ctx.add_step("obsolete_step").set_text("This step is no longer needed.")
ctx.add_step("farewell").set_text("Thank the caller and say goodbye.")
ctx.remove_step("obsolete_step")
agent.serve()