For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
        • addPomAsSubsection
        • addSection
        • addSubsection
        • addToSection
        • findSection
        • fromSections
        • getSection
        • hasSection
        • renderMarkdown
        • renderXml
        • reset
        • toDict
        • toJson
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Methods
  • Examples
  • Building a structured prompt
  • Incremental construction
Agents

PomBuilder

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

addPomAsSubsection

Next
Built with

PomBuilder provides a fluent interface for creating structured prompts using the Prompt Object Model (POM). POM organizes prompt content into titled sections, subsections, and bullet lists — producing consistent, well-structured prompts that the AI can follow reliably.

Use PomBuilder when you need fine-grained control over prompt structure beyond what setPromptText() and promptAddSection() on AgentBase provide. The builder can render to Markdown format.

Methods

addSection

Add a new top-level section to the POM.

addSubsection

Add a subsection to an existing section.

addToSection

Add content to an existing section.

findSection

Find a section by title for direct manipulation.

getSection

Get a top-level section by title.

hasSection

Check if a section with a given title exists.

renderMarkdown

Render the POM as a Markdown string.

renderXml

Render the POM as an XML document.

toDict

Convert the POM to a list of section objects.

toJson

Serialize all sections to a JSON string.

fromSections

Create a new PomBuilder from section data (static).

addPomAsSubsection

Append another PomBuilder’s sections as subsections.

reset

Clear all sections and start over.

Examples

Building a structured prompt

1import { PomBuilder } from '@signalwire/sdk';
2
3const pom = new PomBuilder();
4pom.addSection('Role', { body: 'You are a helpful assistant.' });
5pom.addSection('Rules', { bullets: ['Be concise', 'Be accurate'] });
6
7const markdown = pom.renderMarkdown();
8console.log(markdown);

Incremental construction

1import { PomBuilder } from '@signalwire/sdk';
2
3const pom = new PomBuilder();
4
5// Start with a basic section
6pom.addSection('Capabilities', { body: 'You can help with the following:' });
7
8// Add bullets incrementally as skills are loaded
9pom.addToSection('Capabilities', { bullet: 'Weather lookups' });
10pom.addToSection('Capabilities', { bullet: 'Calendar scheduling' });
11pom.addToSection('Capabilities', { bullets: [
12 'Order tracking',
13 'Account management',
14] });
15
16// Add a subsection
17pom.addSubsection('Capabilities', 'Limitations', {
18 body: 'You cannot process payments directly.',
19});
20
21console.log(pom.renderMarkdown());