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
  • Parameters
  • Returns
  • Example
AgentsPomBuilder

addPomAsSubsection

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

addSection

Next
Built with

Append every top-level section of another PomBuilder as a subsection of a target section in this builder. Useful for composing prompts assembled separately into a single document.

Throws Error("No section with title '<target>' found.") when target is a string and no section with that title exists. For deeper lookups, resolve the section yourself via findSection() and pass the PomSection directly.

Parameters

target
string | PomSectionRequired

The target section to append into. Pass a title string for top-level sections, or a PomSection instance (from findSection()) for nested sections.

pomToAdd
PomBuilderRequired

The builder whose sections should be appended.

Returns

this — returns the builder for fluent chaining.

Example

1import { PomBuilder } from '@signalwire/sdk';
2
3const subPom = new PomBuilder();
4subPom.addSection('Policy A', { body: 'Always greet by name.' });
5subPom.addSection('Policy B', { body: 'Escalate billing issues.' });
6
7const main = new PomBuilder();
8main.addSection('Introduction', { body: 'You are a helpful agent.' });
9main.addSection('Policies');
10
11main.addPomAsSubsection('Policies', subPom);
12console.log(main.renderMarkdown());