set_text

View as MarkdownOpen in Claude

Set the step’s prompt text directly. Cannot be used with add_section() or add_bullets().

Mixing set_text() with add_section() or add_bullets() raises ValueError. Use one approach or the other.

Parameters

text
strRequired

Plain-text prompt instructions for 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")
step = ctx.add_step("greeting")
step.set_text("Welcome the caller and ask how you can help.")
agent.serve()