add_section

View as MarkdownOpen in Claude

Add a POM section to the context prompt. Cannot be used together with set_prompt().

Parameters

title
strRequired

Section heading.

body
strRequired

Section body text.

Returns

Context — Self for method chaining.

Example

from signalwire import AgentBase
agent = AgentBase(name="my-agent", route="/agent")
contexts = agent.define_contexts()
ctx = contexts.add_context("default")
ctx.add_section("Role", "You are a billing specialist.")
ctx.add_section("Guidelines", "Always verify account ownership first.")
ctx.add_step("greet").set_text("Greet the caller and ask how you can help.")
agent.serve()