***

title: stop
slug: /reference/python/relay/actions/ai-action/stop
description: Stop the AI agent session.
max-toc-depth: 3
---------------------

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

Stop the AI agent session.

## **Returns**

`dict` -- Server acknowledgment.

## **Example**

```python {19}
from signalwire.relay import RelayClient

client = RelayClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
    contexts=["default"],
)

@client.on_call
async def handle_call(call):
    await call.answer()
    action = await call.ai(
        prompt={"text": "You are a helpful assistant."},
        ai_params={"temperature": 0.7},
    )

    # Stop the AI session
    await action.stop()

client.run()
```