set_end

View as MarkdownOpen in Claude

Set whether the conversation should end after this step completes.

Parameters

end
boolRequired

Whether to end the conversation after this step.

Returns

Step — 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("Welcome the caller.")
8farewell = ctx.add_step("farewell")
9farewell.set_text("Thank you for calling. Goodbye!")
10farewell.set_end(True)
11
12agent.serve()