Is it possible to edit the message content?

The assistant docs shows an API call for modifying a message:
https://platform.openai.com/docs/api-reference/messages/modifyMessage
However the example only shows “metadata” in the body. Can I somehow modify the content text as well?

When I try this:

const message = await openai.beta.threads.messages.update(threadId, messageId, { content: [{ type: 'text', text: { value: newContent } }] })

I get this error:

Error: 400 1 validation error for Request
body -> content
  extra fields not permitted (type=value_error.extra)

Anyone managed to edit or delete a message? I really need it.
Thanks.

My suggestion to you would be to read through the documentation that uses the scripting language like CURL etc and write out the Python equivalent using requests. Ask your friend to do it…

That’s a nope.

Chat completions and your own conversation management is what you’d need if you want reasonable and ultimate control of what is sent to the AI model with every call, that every call also being under your control.

Examples for all languages show just the metadata editing. :-/

I need both control and RAG. :-/

Don’t use the examples. There are not many and they are not great. Like I said… Ask your friend to help you. Nudge nudge. You ultimately can control the messages you send to the API, but I am not 100% sure what you are trying to edit the Thread and Messages objects for. I’m being intentionally vague as I don’t want to give away too much.

Retrieval-Augmented Generation also isn’t guaranteed with assistants.

In-context AI iterative database retrieval is more apt a name.

That is, when you don’t have “everything loaded into AI context window simply because it fits”.

It seems instead of embeddings database as a primary method, OpenAI uses tool function-calling by the AI itself to probe documents to load into AI context.

Messages metadata might have future uses were you given more control, like storing token counts of messages there, which OpenAI didn’t do and won’t report.

I don’t understand what your motivation is.

Yes I have the same question. I spent a few hours trying it out, but looks like I can only edit the metadata - I don’t quite get why there is a “modify message” in the API if you actually indeed cannot modify a message…

I’m trying to implement what you can do on the website - i.e. edit the last message and go in a different direction.

You’d have to move over (back?) to chat completions to regain control of the AI. I made a rant-y wishlist of granted wishes that have only been taken away by Assistants:

Of course add control of sampling parameters, knowledge injection, conversation enhancement and management,… just limited by one’s creativity instead of another’s.