You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dotenv.config();
import OpenAI from 'openai';
const configuration = {
apiKey: process.env.OPENIA_KEY,
};
const openai = new OpenAI(configuration);
//console.log(openai.images);
import express from 'express';
import cors from 'cors';
const app = express();
app.use(cors());
app.use(express.json());
app.post('/dream', async (req, res) => {
const prompt = req.body.prompt;
const aiResponse = await openai.images.generate({
model: 'dall-e-3',
prompt: prompt,
});
console.log(image.data);
const image = aiResponse.data.data[0].url;
res.send({ image });
});
app.listen(8080, () => console.log('make art on http://localhost:8080/dream'));
`
the way to request data from openia change from some update. but is not problem and all 😁
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: