addSection

View as MarkdownOpen in Claude

Add a POM section to the context prompt. Cannot be used together with setPrompt().

Parameters

title
stringRequired

Section heading.

body
stringRequired

Section body text.

Returns

Context — Self for method chaining.

Example

1import { ContextBuilder } from '@signalwire/sdk';
2
3const builder = new ContextBuilder();
4const ctx = builder.addContext('default');
5ctx.addSection('Role', 'You are a billing specialist.');
6ctx.addSection('Guidelines', 'Always verify account ownership first.');
7ctx.addStep('greet').setText('Greet the caller and ask how you can help.');