Closed anamansari062 closed 1 year ago
OpenAI GPT-3 will be used for the task. Following is the JS code example. Please specify the file to add the code in.
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-003",
prompt: "Given list of emotions and a sentence, tell me the emotion of the sentence from the given list. Gererate 3 best possible classifications. Generate only the response keywords, don't generate any other text. Keep the output characters in lowercase.\n\nList of emotions: [admiration, adoration, appreciation of beauty, amusement, anger, anxiety, awe, awkwardness, boredom, calmness, confusion, craving, disgust, empathic pain, entrancement, excitement, fear, horror, interest, joy, nostalgia, relief, sadness, satisfaction, and surprise]\n\nSentence: she dumped me",
temperature: 0.7,
max_tokens: 256,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
});
Resolved. Closing the issue.
Description