Skip to main content

Delete Conversations

Deleting a conversation means that you can delete the text content of specified conversations corresponding to unique conversation IDs.

Steps to Delete Conversations

  1. Create an object of the DeleteConversationRequest class using the DeleteConversationRequestBuilder class and specify the conversation IDs.
  2. Call deleteConversation() present in the LMChatClient class using your request object.
  3. Process the response LMResponse<DeleteConversationResponse> as per your requirement.
DeleteConversationRequest request = (DeleteConversationRequestBuilder()
..conversationIds("ENTER_CONVERSATION_IDS")
..reason("ENTER_REASON"))
.build();

LMResponse<DeleteConversationResponse> response =
await lmClient.deleteConversation(request);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response.errorMessage);
}

Models

DeleteConversationRequest

List of parameters for the DeleteConversationRequest class

VariableTypeDescriptionOptional
conversationIdsList<int>List of conversation IDs
reasonStringReason for conversation deletion

DeleteConversationResponse

List of parameters for the DeleteConversationResponse class

VariableTypeDescriptionOptional
conversationsList<Conversation>?List of conversation objects✔️