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
- Create an EditConversationRequest object with the required parameters using its builder pattern.
- Call the
editConversation()
function using an instance ofLMChatClient
, passing therequest
object. - 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.
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
conversationId | String | ID of the conversation to be updated | |
text | String | Updated text content of the conversation | |
shareLink | String? | Optional link to be shared with the conversation | ✔️ |
EditConversationResponse
Represents the response object containing the updated conversation details.
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
conversation | Conversation | The updated conversation object |