close

View as MarkdownOpen in Claude

Close the session. A client constructed with your own session= leaves that session alone, since it did not create it.

Using the client as an async context manager calls this for you on exit, which is the usual way to reach it.

Parameters

None.

Returns

None.

Example

Outside a context manager, close it yourself:

1import asyncio
2
3from signalwire.ai_chat import AIChatClient
4
5
6async def main():
7 client = AIChatClient(space="your-space")
8 try:
9 reply = await client.chat("chat-8f21", "Where is my van?")
10 print("Ada:", reply.text)
11 finally:
12 await client.close()
13
14
15asyncio.run(main())