I’m trying to run a script and keep getting this in the terminal “TypeError: openai.createCompletion is not a function” I’m trying to use the OpenAiAPI but having some issues with it. Has anyone experienced this TypeError?
I’m using: model this text-model: “text-davinci-002”,
This is how I import it: const OpenAIAPI = require(“openai”);
Node -v: v16.20.2
OpenAi -v: ^4.11.1
text-davinci-002 is a quite old model, indicating that you either found some old guide, or asked ChatGPT how to write some code.
The OpenAI library version 4 has significant changes that you have to read about, and you will likely want to be using model gpt-3.5-turbo for typical chatbot applications which employs the ChatCompletion method.
Good day, I am working with Dall E for image creation. Are there migration docs for image creation too and not just text completion. I am getting an erro that says “Error creating image: Request failed with status code 401”
I have taken a look at the openai repository and I am trying to use the v4 for image completion but I am facing issues. The chat samples I am seeing are for chat completion, I need to an API sample thanks