> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# Section

> A single section in a PromptObjectModel: title, body, bullets, and nested subsections.

[pom]: /docs/server-sdks/reference/typescript/agents/pom-object-model

A `Section` is a single node in a [`PromptObjectModel`][pom] tree. Each section
has a title, optional body text, optional bullet points, and any number of
nested subsections.

```typescript {1}
import { Section } from '@signalwire/sdk';

const section = new Section('Role', { body: 'You are a helpful assistant.' });
section.addBullets(['Be concise', 'Be accurate']);
console.log(section.renderMarkdown());
```

## **Constructor**

Section title. `null` is permitted only on the very first top-level section
of a model.

Optional section content.

Section body text.

List of bullet point strings.

Whether this section is numbered when rendered.

Whether bullet points are rendered as a numbered list instead of using bullet
markers.

## **Properties**

Section heading text, or `null` if untitled.

Section body paragraph text.

List of bullet point strings.

Nested child sections.

Whether this section is numbered when rendered.

Whether bullet points are rendered as a numbered list.

## **Methods**

### addBody

```typescript {1}
addBody(body: string): void
```

Set or replace the body text for this section.

The body paragraph text.

### addBullets

```typescript {1}
addBullets(bullets: string[]): void
```

Append bullet points to this section, extending the existing list.

Bullet point strings to add.

### addSubsection

```typescript {1}
addSubsection(title: string, opts?): Section
```

Add a titled subsection to this section and return it. Subsections must have a
title.

Subsection title.

Optional `body`, `bullets`, `numbered`, and `numberedBullets` for the
subsection.

Returns the newly created `Section`.

### toDict

```typescript {1}
toDict(): SectionData
```

Convert this section (and its subsections) to a plain
[`SectionData`][pom] object.

### renderMarkdown

```typescript {1}
renderMarkdown(level?: number, sectionNumber?: number[] | null): string
```

Render this section and its subsections as Markdown.

The heading level to start at (`2` renders a `##` heading).

The current section number used for numbered sections.

### renderXml

```typescript {1}
renderXml(indent?: number, sectionNumber?: number[] | null): string
```

Render this section and its subsections as XML.

The indentation level to start at.

The current section number used for numbered sections.