#Configuration is not a Constructor

1 messages · Page 1 of 1 (latest)

glad walrus
#
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);```
why does it say: 
TypeError: Configuration is not a constructor?
restive helm
#

what openai package version are you using

glad walrus
#

how can i show me this?

#

openai@4.10.0

restive helm
#

npm list in your console, it should show all your installed package versions

glad walrus
#

version 4.10.0

restive helm
#

v3 used the configuration class, its been since deprecated

#

follow the https://www.npmjs.com/package/openai there for up to date examples

glad walrus
#

ah ok

restive helm
#

👌 happy coding