Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
515 B
8
Indexable
 NLPCloudClient = require('nlpcloud');
const { Configuration, OpenAIApi } = require("openai");

var text = input.substring(8)
const configuration = new Configuration({
  apiKey: "Yung api key mo",
});
const openai = new OpenAIApi(configuration);
const {data} = await openai.createCompletion("text-davinci-002", {
  prompt: text,
  temperature: 0.6,
  max_tokens: 500,
  top_p: 1,
  frequency_penalty: 0.3,
  presence_penalty: 0.0,
});
          api.sendMessage(data.choices[0].text, event.threadID, event.messageID)