What are the possible ways to add the message editing functionality (like in chatgpt) for the Assistants?


In chatgpt the user can edit a message and complete the thread without losing the old message which may have been followed by several user-assistant messages, so he can move between old and new branches and create new ones without losing any parts of the conversation.

In the API assistants, there is an edit message endpoint, but using it for this functionality means deleting any subsequent messages so the assistant does not consider them, and re-create these messages (maybe using the additional_messages parameter when creating a run) if the user has navigated back to them.

So whenever the user moves from one branch to another and completes the thread, a list of messages should be deleted and another list should be re-created.

Is this the way to enable this functionality? Are there any better ways to do it?