hey, there is a website I’d like to use his API in a P5 sketch I’m doing.
The API looks like that:
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createCompletion({
model: "text-davinci-002",
prompt: "Decide whether a Tweet's sentiment is positive, neutral, or negative.\n\nTweet: \"I loved the new Batman movie!\"\nSentiment:",
temperature: 0,
max_tokens: 60,
top_p: 1,
frequency_penalty: 0.5,
presence_penalty: 0,
});
I tried looking up an answer but couldn’t find one.
does anyone have any idea?
thanks