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

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