- Joined
- Apr 13, 2017
- Posts
- 4,777
- Solutions
- 53
- Reaction
- 13,569
- Points
- 2,792
- Age
- 21
MAGANDANG UMAGA MGA KUYS
Sa mga gising na mamaw mag code jan, baka pwede po maka hingi ng tulong about dito sa javascript code po ng OpenAI
JavaScript:
const { Configuration, OpenAIApi } = require("openai");
const fs = require("fs")
const apikey = JSON.parse(fs.readFileSync('./api_key.json', 'utf8'))
const configuration = new Configuration({apiKey: apikey.openai});
const openai = new OpenAIApi(configuration);
async function ai(matches, event, api) {
var text = matches[1];
console.log(matches)
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: event.body,
temperature: 0.3,
max_tokens: 3000,
});
api.sendMessage(`${response.data.choices[0].text}`, event.threadID)
}
module.exports = ai;
Bali ang gusto kopo sana na mag reply yung bot sa akin, ang ginagawa nya po kasi is rektahan lng sha mag sagot;
Want ko sana na yung response nya is gaya nito;
Sa
/ai
lng po sha di nag rereply pero the rest sa command nagana naman, nag trial and error pala ako kanina pero bigo sabi daw invalid or unknown function :<Attachments
-
You do not have permission to view the full content of this post. Log in or register now.