PomBuilder
PomBuilder provides a fluent interface for creating structured prompts using the Prompt Object Model (POM). POM organizes prompt content into titled sections, subsections, and bullet lists — producing consistent, well-structured prompts that the AI can follow reliably.
Use PomBuilder when you need fine-grained control over prompt structure beyond
what set_prompt_text() and prompt_add_section() on
AgentBase provide. The builder
can render to Markdown or XML format.
PomBuilder requires the signalwire-pom package. Install it with:
pip install signalwire-pom
Methods
Add a new top-level section to the POM.
Add a subsection to an existing section.
Add content to an existing section.
Create a PomBuilder from a list of section dictionaries.
Get a section by title for direct manipulation.
Check if a section with a given title exists.
Render the POM as Markdown or XML.
Convert the POM to a list of section dictionaries.
Convert the POM to a JSON string.