Recently, we are getting errors from OpenAI API which result in non gracefully exited threads. IMO it would be great to introduce some simple error handling like described in https://www.npmjs.com/package/openai?activeTab=readme#Usage
Working on this right now. Pull request will follow.