add_section

View as MarkdownOpen in Claude

Add a POM section to the step. Cannot be used with set_text().

Parameters

title
strRequired

Section heading (rendered as a Markdown ## heading).

body
strRequired

Section body text.

Returns

Step — Self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="my-agent", route="/agent")
4
5contexts = agent.define_contexts()
6ctx = contexts.add_context("default")
7step = ctx.add_step("collect_info")
8step.add_section("Task", "Collect the caller's account information.")
9step.add_section("Guidelines", "Be polite and patient. Confirm each piece of information.")
10
11agent.serve()