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

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