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

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