add_system_section

View as MarkdownOpen in Claude

Add a POM section to the system prompt. Cannot be combined with set_system_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()
contexts.add_context("default").add_step("menu").set_text("Ask what the caller needs.")
billing = contexts.add_context("billing")
billing.add_system_section("Role", "You are a billing specialist.")
billing.add_system_section("Tone", "Be professional and empathetic.")
billing.add_step("review").set_text("Review the caller's account and recent charges.")
agent.serve()