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
Optional[list[str]]

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
Optional[list[dict[str, Any]]]

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

Returns

PomBuilder — Self for method chaining.

Example

1from signalwire.core.pom_builder import PomBuilder
2
3pom = PomBuilder()
4
5pom.add_section(
6 "Role",
7 body="You are a customer service representative for Acme Corp."
8)
9
10pom.add_section(
11 "Guidelines",
12 bullets=[
13 "Always greet the customer by name when available",
14 "Be concise and professional",
15 "Never make promises about timelines you cannot keep"
16 ]
17)
18
19pom.add_section(
20 "Product Knowledge",
21 body="You have access to the product catalog.",
22 subsections=[
23 {
24 "title": "Pricing",
25 "body": "Always quote current prices from the catalog."
26 },
27 {
28 "title": "Returns",
29 "body": "30-day return policy for all items."
30 }
31 ]
32)
33
34print(pom.render_markdown())