addSection

View as MarkdownOpen in Claude

Add a POM section to the step. Cannot be used with setText().

Parameters

title
stringRequired

Section heading (rendered as a Markdown ## heading).

body
stringRequired

Section body text.

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('collect_info');
6step.addSection('Task', 'Collect the caller\'s account information.');
7step.addSection('Guidelines', 'Be polite and patient. Confirm each piece of information.');