Elliott-Chong / quizmify

https://quizmify.vercel.app
225 stars 102 forks source link

openai is not working... #10

Open flan02 opened 6 months ago

flan02 commented 6 months ago

When a random programmer try to practice with this example, they will have problem configuring openai because Elliot made this example running openai v3 and it doesn't work anymore. I could fix the config for openai v4. The current problem will be in [gpt.ts file] and I use this config to solve the issue:

// openai V4

import OpenAi from "openai"

const openai = new OpenAi({
  apiKey: process.env.OPENAI_API_KEY
});