Assistant Thread Run and Empty Assistant Role Message

I don’t recall reading this but would like to know if this is by design and/or correct.

Assistant API Process

  1. Create Thread
  2. Submit Message to Thread
  3. Create Run for Thread
  4. At this point the code might retrieve a list of messages, I noticed that there is always an empty Assistant Role message
  5. Poll run until Complete (generally speaking)
  6. Retrieve List

My question: Is the API going to create an empty content message and then fill it in?

Good question. I hadn’t noticed it till yesterday. When I at last managed to come up with a perfect way to capture all message(s) that could be created in the processes of the runs, that issue was appearing on the Assistant message created as a result of the code_interpreter tool_calls. Essentially it was creating an empty assistant role message then after a second or two, the assistant role would get the message but don’t be so sure…The Assistant role in some cases is just blank …not all the time having messages, but regarding your question, I experienced the delayed appending of messages to the assistant role

I think it is always empty and it depends on how quickly you poll the thread for messages. It is kind of difficult to pin down because you can’t get the message list and run details at the same time to be able to check the status if it is complete.

I will just assume for the time being that an empty assistant message should be ignored.

Your code should be able to confirm a run has been completed (all steps finished) before you can list messages. You can’t list messages if run is still in process, what are you trying to retrieve when the run is the one to create messages?