to_json

View as MarkdownOpen in Claude

Convert the POM to a JSON string.

Returns

str — JSON representation of the POM.

Example

1from signalwire.core.pom_builder import PomBuilder
2
3pom = PomBuilder()
4pom.add_section("Role", body="You are a helpful assistant.")
5pom.add_section("Rules", bullets=["Be concise", "Be accurate"])
6
7json_str = pom.to_json()
8print(json_str)