add_section

View as MarkdownOpen in Claude

Add a new top-level section to the POM.

Parameters

title
strRequired

Section title.

body
str

Section body text.

bullets
list[str] | NoneDefaults to None

List of bullet points for this section.

numbered
boolDefaults to False

Whether to number this section in the rendered output.

numbered_bullets
boolDefaults to False

Whether to number bullet points instead of using bullet markers.

subsections
list[dict[str, Any]] | NoneDefaults to None

List of subsection objects, each with "title", optional "body", and optional "bullets" keys.

Returns

PomBuilder — Self for method chaining.

Example

from signalwire.core.pom_builder import PomBuilder
pom = PomBuilder()
pom.add_section(
"Role",
body="You are a customer service representative for Acme Corp."
)
pom.add_section(
"Guidelines",
bullets=[
"Always greet the customer by name when available",
"Be concise and professional",
"Never make promises about timelines you cannot keep"
]
)
pom.add_section(
"Product Knowledge",
body="You have access to the product catalog.",
subsections=[
{
"title": "Pricing",
"body": "Always quote current prices from the catalog."
},
{
"title": "Returns",
"body": "30-day return policy for all items."
}
]
)
print(pom.render_markdown())