AgentsAgentBase

set_post_prompt

View as MarkdownOpen in Claude

Set the post-prompt text for summary generation. After a conversation ends, the AI uses this prompt to analyze the conversation and generate a structured summary. The summary is delivered to your on_summary() callback or the set_post_prompt_url() endpoint.

Parameters

text
strRequired

Instructions for summary generation. Tell the AI what to extract from the conversation — for example, caller intent, resolution status, or action items.

Returns

AgentBase — Returns self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="support", route="/support")
4agent.set_prompt_text("You are a customer support agent for Acme Corp.")
5agent.set_post_prompt("""
6Summarize this conversation as JSON with the following fields:
7- caller_intent: What the caller wanted
8- resolution: Whether their issue was resolved (yes/no/partial)
9- action_items: List of follow-up actions needed
10- sentiment: Overall caller sentiment (positive/neutral/negative)
11""")
12agent.serve()