end

View as MarkdownOpen in Claude

End the conversation and start post-processing: the summary, and a request to your post_prompt_url when your SWML sets one. The webhook is not instant, so expect seconds.

To remove a conversation without any of that, use delete().

Parameters

conversation_id
strRequired

The conversation to end.

Returns

boolTrue when the service reported the conversation ended, False when no conversation had that id.

Example

1import asyncio
2
3from signalwire.ai_chat import AIChatClient
4
5CONFIG_URL = "https://bayview-taxi.example.com/swml"
6
7
8async def main():
9 async with AIChatClient(space="your-space") as client:
10 await client.create_conversation("chat-8f21", config_url=CONFIG_URL)
11 await client.chat("chat-8f21", "Book the van, please.")
12 await client.end("chat-8f21")
13
14
15asyncio.run(main())

The AI post-prompt callback documents what your post_prompt_url receives.