How to end a conversation manually ?
# ask-ai
f
How to end a conversation manually ?
t
Thanks for reaching out, Roshan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To gently wrap up a conversation in LiveKit, here are a few friendly ways you can do it: • Leave the room as an individual participant: You can simply call the
Room.disconnect()
method in your client app. For instance, in a React app, you might connect this to a "Leave Room" button for an easy exit. • End the session for everyone: On the server side, you can use the
DeleteRoom
API. This will kindly disconnect all participants and tidy up by removing the room from the server. • Disconnect just an AI agent: Use the agent’s shutdown process, making sure all tasks are wrapped up before calling
session.aclose()
. If you’d like, I’m here to help with detailed examples or any other questions you have—just let me know! Sources: Connecting to LiveKit | LiveKit docs | complex-agents/note-taking-assistant/note-taker-frontend/components/livekit... | Job lifecycle | LiveKit Docs | Agent Session & Client Integration | livekit/livekit_composite | DeepWiki | Turn detection and interruptions | LiveKit Docs
f
Can you show delete room api also explain if it works in console or not ?
t
The DeleteRoom API in LiveKit is a handy way to close a room and gently disconnect all participants. Let me walk you through how you can use it: • Using Server SDKs: You have the option to call the
deleteRoom
method in several SDKs like Python, Node.js, Kotlin, Ruby, or Rust. For instance, in Node.js, it looks like this:
Copy code
import { RoomServiceClient } from 'livekit-server-sdk';

const svc = new RoomServiceClient('livekitHost', 'api-key', 'secret-key');

svc.deleteRoom('room-name').then(() => {
  console.log('Room deleted');
});
• Using the LiveKit CLI: If you prefer the command line, you can delete a room with this simple command:
Copy code
lk room delete ROOM_NAME_OR_ID
Just a quick note: the DeleteRoom API isn’t available through the web-based console, but you’ll find it works smoothly via the CLI or programmatically through the SDKs. If you have any questions or want some help with getting this set up, I’m here for you!