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

1from signalwire import AgentBase
2
3agent = AgentBase(name="my-agent", route="/agent")
4
5contexts = agent.define_contexts()
6ctx = contexts.add_context("default")
7step = ctx.add_step("greeting")
8step.set_text("Welcome the caller and ask how you can help.")
9
10agent.serve()