getPrompt

View as MarkdownOpen in Claude

Return the fully rendered prompt text. If raw text was set via setPromptText(), it is returned directly. Otherwise, POM sections are rendered to Markdown. Returns an empty string if nothing is configured.

Parameters

None.

Returns

string — The prompt string, or empty string if nothing is set.

Example

import { PromptManager } from '@signalwire/sdk';
const pm = new PromptManager();
pm.addSection('Role', { body: 'You are a helpful assistant.' });
const prompt = pm.getPrompt();
console.log(prompt);
// ## Role
// You are a helpful assistant.