Adjust code to work on the latest version of openai package. See breaking changes https://github.com/openai/openai-node/discussions/217