import "@johnlindquist/kit";
const { Configuration, OpenAIApi } = await npm("openai");
const configuration = new Configuration({
apiKey: await env("OPENAI_API_KEY")
});
const openAI = new OpenAIApi(configuration);
const prompt = await editor("");
const completion = await openAI.createCompletion({
model: "text-davinci-003",
prompt,
temperature: 0,
max_tokens: 4069
});
const choices = completion.data.choices;
const response = choices[0].text;
const containerClassName =
"flex justify-center items-center text-2xl h-full p-10";
await div(response, containerClassName);