toYaml

View as MarkdownOpen in Claude

Serialize the entire model to a YAML string. Internally calls toDict() and dumps the result. Restore later via fromYaml().

Parameters

None.

Returns

string — YAML-serialized array of section data.

Example

import { PromptObjectModel } from '@signalwire/sdk';
const pom = new PromptObjectModel();
pom.addSection('Intro', { body: 'Welcome.' });
const yaml = pom.toYaml();
const restored = PromptObjectModel.fromYaml(yaml);