> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# agent_says

> Add the model's spoken reply to the simulated call, then run any post_process actions waiting for it.

[ref-sim]: /docs/server-sdks/reference/python/agents/testing/call-simulator

[set-post-process]: /docs/server-sdks/reference/python/agents/function-result/set-post-process

The agent says `text`, as the model's reply. It's added to the call log as an
`assistant` turn. When an earlier result was
[`post_process`][set-post-process], its actions run now, after the reply, as the
platform runs them. A test that checks a `post_process` hangup or step change
calls `agent_says()` first.

## Parameters

**`text`** `str` — required

The model's reply.

---

## Returns

[`CallSimulator`][ref-sim] -- Self, for chaining.

## Example

```python {10,13}
from signalwire import AgentBase, FunctionResult
from signalwire.testing import CallSimulator

agent = AgentBase(name="frontdesk", route="/frontdesk")
agent.prompt_add_section("Role", "You answer the front desk.")
agent.define_tool("finish", "End the call after saying goodbye", {"type": "object", "properties": {}},
                  lambda args, raw_data: FunctionResult("Say goodbye.", post_process=True).hangup())

sim = CallSimulator(agent)
sim.call("finish")
print(sim.ended)
# False
sim.agent_says("Thanks for calling. Goodbye!")
print(sim.ended)
# True
```