Skip to navigation

Convert the entire model to an array of plain SectionData objects. Useful for serializing the POM for storage or passing to other components.

Parameters

None.

Returns

SectionData[] — Serialized section list. See the PromptObjectModel overview for the SectionData shape.

Example

import { PromptObjectModel } from '@signalwire/sdk';
const pom = new PromptObjectModel();
pom.addSection('Role', { body: 'You are a helpful assistant.' });
const data = pom.toDict();
console.log(JSON.stringify(data, null, 2));