***

title: set_post_prompt
slug: /reference/python/agents/agent-base/set-post-prompt
description: Set the post-prompt used for generating call summaries after a conversation ends.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[on-summary]: /docs/server-sdks/reference/python/agents/agent-base/on-summary

[set-post-prompt-url]: /docs/server-sdks/reference/python/agents/agent-base/set-post-prompt-url

[ref-agentbase]: /docs/server-sdks/reference/python/agents/agent-base

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()`][on-summary] callback or
the [`set_post_prompt_url()`][set-post-prompt-url] endpoint.

## **Parameters**

<ParamField path="text" type="str" required={true} toc={true}>
  Instructions for summary generation. Tell the AI what to extract from the
  conversation -- for example, caller intent, resolution status, or action items.
</ParamField>

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns self for method chaining.

## **Example**

```python {5}
from signalwire import AgentBase

agent = AgentBase(name="support", route="/support")
agent.set_prompt_text("You are a customer support agent for Acme Corp.")
agent.set_post_prompt("""
Summarize this conversation as JSON with the following fields:
- caller_intent: What the caller wanted
- resolution: Whether their issue was resolved (yes/no/partial)
- action_items: List of follow-up actions needed
- sentiment: Overall caller sentiment (positive/neutral/negative)
""")
agent.serve()
```