addSection

View as MarkdownOpen in Claude

Add a POM section to the prompt. If POM mode was not initially active, it is automatically enabled. The PomBuilder is initialized if needed.

Parameters

title
stringRequired

The section heading.

opts
object

Optional section content.

opts.body
string

Section body text.

opts.bullets
string[]

List of bullet point strings.

opts.numbered
boolean

Whether to number the section heading.

opts.numberedBullets
boolean

Whether to use numbered bullets instead of dashes.

opts.subsections
Array<{ title: string; body?: string; bullets?: string[] }>

Subsections to add under this section.

Returns

void

Example

1import { PromptManager } from '@signalwire/sdk';
2
3const pm = new PromptManager();
4pm.addSection('Role', { body: 'You are a support agent.' });
5pm.addSection('Rules', { bullets: ['Be concise', 'Be polite'] });
6console.log(pm.getPrompt());