to_json

View as MarkdownOpen in Claude

Convert the POM to a JSON string.

Returns

str — JSON representation of the POM.

Example

from signalwire.core.pom_builder import PomBuilder
pom = PomBuilder()
pom.add_section("Role", body="You are a helpful assistant.")
pom.add_section("Rules", bullets=["Be concise", "Be accurate"])
json_str = pom.to_json()
print(json_str)