just use chat completions, much more stable at the moment, and doesnt crash as much.
Preserve the semantics of the assistantAPI but use the mechanics of chat-completion
See my response to @rita.m query here Switching from Assistants API to Chat Completion?
Also see openairetro/examples/hello-world at main · icdev2dev/openairetro · GitHub for sense of how this could be done.