PromptObjectModel
PromptObjectModel is the low-level, serializable representation of a Prompt
Object Model (POM) document — a tree of nested Section objects,
each with a title, body text, bullet points, and arbitrarily nested
subsections. It renders to Markdown or XML and round-trips through JSON and
YAML.
Most agent code uses the higher-level PomBuilder wrapper, but
PromptObjectModel is exposed directly so that callers can work with the same
structure that agent.pom returns and load or save POMs as JSON/YAML.
Constructor
debug
When true, print debug information to the console during
renderMarkdown().
Properties
sections
The top-level Section objects in the model.
debug
Whether debug output is printed during rendering.
Methods
Add a top-level section to the model.
Find a section by title (recursive search).
Append another model’s sections as subsections.
Convert the model to an array of section data objects.
Serialize the model to a JSON string.
Serialize the model to a YAML string.
Render the model as a Markdown string.
Render the model as an XML document.
Build a model from JSON data (static).
Build a model from YAML data (static).
See the Section page for the per-section methods (addBody,
addBullets, addSubsection, toDict, renderMarkdown, renderXml).
SectionData
SectionData is the plain, serializable shape used by
toDict(),
toJson(),
fromJson(), and fromYaml() for exchanging POM data.
title
Section heading. Omitted for the (optional) untitled first section.
body
Section body paragraph text.
bullets
List of bullet point strings.
subsections
Nested child sections, same shape.
numbered
Whether this section is numbered when rendered.
numberedBullets
Whether bullet points are rendered as a numbered list.