Implementing a retry/regenerate response feature (assistants-api)

What’s the best way to implement something similar to the retry button in the chat gpt interface? I don’t see a way to delete a message in a thread. There is
but that doesn’t seem like the way to go to have the assistant essentially regenerate a response and replace an existing message in a thread. Any pointers would be greatly appreciated.