-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
27 lines (24 loc) · 813 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require("dotenv").config();
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
async function result() {
var introprompt =
"Please evaluate the candidate's response in detail. " +
"Please provide negative feedback on the candidate's eagerness to learn, optimism, willingness to collaborate with others, and technical confidence based on their responses to the questions. " +
"Question: " +
question +
"\n" +
"Response: " +
answer +
"\n";
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: introprompt,
temperature: 0.5,
max_tokens: 100,
});
console.log(response.data.choices[0].text);
}