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

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.")
farewell = ctx.add_step("farewell")
farewell.set_text("Thank you for calling. Goodbye!")
farewell.set_end(True)
agent.serve()