getPromptPom

View as MarkdownOpen in Claude

Return the current prompt as a POM (Prompt Object Model) array — the structured, section-based representation built via setPromptPom() or promptAddSection(). Returns null when the agent is configured with a raw text prompt (usePom: false) or when no sections have been added.

Parameters

None.

Returns

Record<string, unknown>[] | null — Array of POM section data objects, or null if not in POM mode or POM is empty.

Example

import { AgentBase } from '@signalwire/sdk';
const agent = new AgentBase({ name: 'support', route: '/support' });
agent.promptAddSection('Role', { body: 'You are a support agent.' });
const sections = agent.getPromptPom();
console.log(sections);