has_section / get_section

View as MarkdownOpen in Claude

has_section

Check if a section with the given title exists.

Parameters

title
strRequired

Section title to check.

Returns

boolTrue if the section exists, False otherwise.


get_section

Get a section by title for direct manipulation.

Parameters

title
strRequired

Section title to look up.

Returns

Section | None — The POM Section object, or None if not found.

Example

from signalwire.core.pom_builder import PomBuilder
pom = PomBuilder()
pom.add_section("Role", body="You are a helpful assistant.")
if pom.has_section("Role"):
section = pom.get_section("Role")
print(f"Found section: {section.title}")
print(pom.has_section("Missing")) # False