setText

View as MarkdownOpen in Claude

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

Mixing setText() with addSection() or addBullets() throws an error. Use one approach or the other.

Parameters

text
stringRequired

Plain-text prompt instructions for this step.

Returns

Step — Self for method chaining.

Example

1import { ContextBuilder } from '@signalwire/sdk';
2
3const builder = new ContextBuilder();
4const ctx = builder.addContext('default');
5const step = ctx.addStep('greeting');
6step.setText('Welcome the caller and ask how you can help.');