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

1from signalwire import AgentBase
2
3agent = AgentBase(name="my-agent", route="/agent")
4
5contexts = agent.define_contexts()
6ctx = contexts.add_context("default")
7ctx.add_step("greet").set_text("Greet the caller.")
8ctx.add_step("obsolete_step").set_text("This step is no longer needed.")
9ctx.add_step("farewell").set_text("Thank the caller and say goodbye.")
10
11ctx.remove_step("obsolete_step")
12
13agent.serve()