BUG: Assistants - streaming responses - thread.message.delta events, characters missing

I am streaming assistant responses into my app and the thread.message.delta events are wrong.

In my case I am streaming a JSON Object response. As I gradually build up the JSON response on the client I often see that the resulting JSON is missing characters. Sometimes it’s just a “:” or a " character missing, but sometimes also full words are missing.

When I look at the thread.message.completed event and extract the data the response is full and does not miss the characters. This is why I believe there must be something wrong with the thread.message.delta events.

I also notice that the openAI assistants playground does not stream the data (we have to wait for the full response). Might be that they don’t stream the data because the team are aware of the bug?

It was of course my fault :person_facepalming: i didn’t see that the SSE event could contain multiple delta events. Most times it was only one delta event per SSE event, but sometimes there were multiple!