AgentsAgentBase

prompt_add_subsection

View as MarkdownOpen in Claude

Add a subsection to an existing section. If the parent section does not exist, it is created automatically.

Parameters

parent_title
strRequired

Title of the parent section.

title
strRequired

Subsection heading.

body
str

Subsection body text.

bullets
Optional[list[str]]

Subsection bullet points.

Returns

AgentBase — Returns self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="support", route="/support")
4agent.prompt_add_section("Capabilities",
5 body="You can help with the following:")
6agent.prompt_add_subsection("Capabilities", "Orders",
7 body="Look up order status, process returns and exchanges.")
8agent.prompt_add_subsection("Capabilities", "Billing",
9 body="Check account balances and explain recent charges.")
10agent.serve()