adrianhajdin / project_threejs_ai

https://jsmastery.pro
897 stars 267 forks source link

Conection to DALL.E fails #14

Closed chauhanarya007 closed 1 year ago

chauhanarya007 commented 1 year ago

I get this error whenever I try to prompt the dalle prompt from client side: Failed to load resource: the server responded with a status of 500 (Internal Server Error) can anyone help?

quikdave commented 1 year ago

I'm getting same, seems to be CORS causing it. Investigating.

quikdave commented 1 year ago

Hi guys,

I found that the openAI key in the .env variable is not been accepted in the dalle.route.js. As a work around I manually updated the dalle.routes.js with the the key

const config = new Configuration({ apiKey: process.env.OPENAI_API_KEY, });

const config = new Configuration({ apiKey: ACTUAL OPENAI KEY, });

This got the project to start accepting AI commands from the chat section. I'm still investigating why this variable is not been parsed but it gets the project working so you can move on.

chauhanarya007 commented 1 year ago

Guys I figured out the problem, you need to check on the open ai platform if you have free credits or not, for me all were used so I had to pay for them and it started working fine. Hope it helps