Delete Conversation
Deleting a conversation means that you can delete the text content of specified conversation corresponding to a unique conversation ID.
Steps to delete a conversation
- To delete a conversation, use the method
deleteConversations()
provided by the client you initialised. - Pass in the required parameter
conversationIds
andreason
. - Process the response of type
LMResponse<Nothing>
as per your requirement.
const payload = {
conversationIds: [], // Pass in the id's of the conversation you want to delete.
reason: "", // Pass in the reason to delete the conversation.
};
const response = await lmChatClient?.deleteConversations(payload);
if (response.success) {
// your function to process the response data
const conversationId: response?.data?.conversations?.id, // Pass in the id of the conversation you want to delete.
user: {}, // Pass in logged uer info
conversations: []; // Pass in the list of the conversations from which you want to delete the item.
// to update message locally
await lmChatClient?.deleteConversation(conversationId, user, conversations);
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Delete Conversations Payload
List of parameters required by the deleteConversations()
method.
Variable | Type | Description | Optional |
---|---|---|---|
conversationIds | number[] | Conversations Ids | |
reason | string | Reason for conversation deletion |