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
        • AuthHandler
        • ConfigLoader
        • Environment Variables
        • Logging
        • PromptManager
          • addSection
          • addSubsection
          • addToSection
          • getPomBuilder
          • getPostPrompt
          • getPrompt
          • hasSection
          • setPostPrompt
          • setPromptText
        • SchemaUtils
        • ServerlessAdapter
        • SessionManager
        • SslConfig
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • 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
  • Constructor
  • Methods
  • Example
AgentsConfiguration

PromptManager

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

addSection

Next
Built with

PromptManager manages agent prompt text, supporting both raw text and structured POM-based prompts. When POM mode is active (the default), sections are rendered to Markdown via the underlying PomBuilder.

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

Constructor

usePom
booleanDefaults to true

Whether to use structured POM sections. When false, only raw text via setPromptText() is supported.

Methods

setPromptText

Set raw prompt text, bypassing POM rendering.

setPostPrompt

Set the post-prompt text appended after the main prompt.

addSection

Add a POM section with body, bullets, or subsections.

addToSection

Append body text or bullets to an existing POM section.

addSubsection

Add a subsection under a parent POM section.

hasSection

Check whether a POM section with the given title exists.

getPrompt

Return the fully rendered prompt text.

getPostPrompt

Return the post-prompt text.

getPomBuilder

Return the underlying PomBuilder instance.

Example

1import { PromptManager } from '@signalwire/sdk';
2
3const pm = new PromptManager();
4pm.addSection('Role', { body: 'You are a friendly customer support agent.' });
5pm.addSection('Rules', { bullets: ['Be concise', 'Be polite', 'Never guess'] });
6pm.setPostPrompt('Summarize the conversation in JSON format.');
7
8console.log(pm.getPrompt());
9// ## Role
10// You are a friendly customer support agent.
11//
12// ## Rules
13// - Be concise
14// - Be polite
15// - Never guess