addToSection

View as MarkdownOpen in Claude

Append body text or bullets to an existing POM section, creating it if absent.

Parameters

title
stringRequired

The section heading to append to.

opts
object

Content to add.

opts.body
string

Body text to append.

opts.bullet
string

A single bullet point to add.

opts.bullets
string[]

Multiple bullet points to add.

Returns

void

Example

1import { PromptManager } from '@signalwire/sdk';
2
3const pm = new PromptManager();
4pm.addSection('Rules', { bullets: ['Be concise'] });
5pm.addToSection('Rules', { bullet: 'Be polite' });
6pm.addToSection('Rules', { bullets: ['Never guess', 'Stay on topic'] });
7console.log(pm.getPrompt());