Skip to main content

Edit Conversation

Edits an existing conversation by sending a request with updated details. The response contains the updated conversation object.

Steps to Edit a Conversation

  1. Create an EditConversationRequest object with the required parameters using its builder pattern.
  2. Call the editConversation() function using an instance of LMChatClient, passing the request object.
  3. Handle the response LMResponse<EditConversationResponse> to process the updated conversation or any errors.
// Create a request to edit a conversation
let editRequest = EditConversationRequest.builder()
.conversationId("ENTER_CONVERSATION_ID")
.text("YOUR_TEXT")
.build()

// Use LMChatClient to edit the conversation
LMChatClient.shared.editConversation(request: editRequest) { response in
switch response {
case .success(let editResponse):
print("Conversation updated successfully: \(editResponse.conversation)")
case .failure(let error):
print("Failed to update conversation: \(error.localizedDescription)")
}
}

Models

EditConversationRequest

Represents the request object used to modify a conversation. Uses a builder pattern to create instances.

VARIABLETYPEDESCRIPTIONOPTIONAL
conversationIdStringID of the conversation to be updated
textStringUpdated text content of the conversation
shareLinkString?Optional link to be shared with the conversation✔️

EditConversationResponse

Represents the response object containing the updated conversation details.

VARIABLETYPEDESCRIPTIONOPTIONAL
conversationConversationThe updated conversation object