Skip to main content

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

  1. Create an object of the DeleteConversationRequest class using the DeleteConversationRequestBuilder class and specify the conversation ID.
  2. For deleting a conversation call deleteConversation() present in LMChatClient class using your request object.
  3. Process the response (LMResponse<DeleteConversationResponse>) as per your requirement.
final LMChatClient lmClient = ...;

DeleteConversationRequest request = (DeleteConversationRequestBuilder()
..conversationId(273099))
.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);
}

Models

DeleteConversationRequest

List of parameters for the DeleteConversationRequest class

VariableTypeDescriptionOptional
conversationIdsList<int>Conversations Ids
reasonStringReason for conversation deletion

DeleteConversationResponse

List of parameters for the DeleteConversationResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageString?Error message in case of failure✔️
conversationsList<Conversation>?List of conversation objects✔️