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

# addPomAsSubsection

> Append another model's sections as subsections of a target section.

[ref-findsection]: /docs/server-sdks/reference/typescript/agents/pom-object-model/find-section

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

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

Append every top-level section of another [`PromptObjectModel`][ref-pom] as a
subsection of a target section in this model. Useful for composing prompts
assembled separately into a single document.

Throws `Error("No section with title '<target>' found.")` when `target` is a
string and no section with that title exists. For deeper lookups, resolve the
section yourself via [`findSection()`][ref-findsection] and pass the
[`Section`][ref-section] directly.

## **Parameters**

The target section to append into. Pass a title string for top-level
sections, or a [`Section`][ref-section] instance (from
[`findSection()`][ref-findsection]) for nested sections.

The model whose top-level sections should be appended.

## **Returns**

`void`

## **Example**

```typescript {11}
import { PromptObjectModel } from '@signalwire/sdk';

const sub = new PromptObjectModel();
sub.addSection('Policy A', { body: 'Always greet by name.' });
sub.addSection('Policy B', { body: 'Escalate billing issues.' });

const main = new PromptObjectModel();
main.addSection('Introduction', { body: 'You are a helpful agent.' });
main.addSection('Policies', { body: 'Apply the following:' });

main.addPomAsSubsection('Policies', sub);
console.log(main.renderMarkdown());
```