Skip to content

Commit

Permalink
update /chat to 3.5turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
LarmuseauNiels committed Mar 21, 2023
1 parent 4e7ea3f commit e8c4170
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
14 changes: 4 additions & 10 deletions interactions/commands/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@ module.exports = {
const openai = new OpenAIApi(configuration);
try {
await interaction.deferReply();
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: `I am the kraken a highly intelligent question answering bot designed for the flaming palm gaming clan. If you ask me a question that is rooted in truth, I will give you the answer. If you ask me a question that is nonsense, trickery, or has no clear answer, I will answer with a sarcastic response.\n\nQ: ${message} \nA:`,
temperature: 0,
max_tokens: 100,
top_p: 1,
frequency_penalty: 0.0,
presence_penalty: 0.0,
stop: ["\n"],
const response = await openai.createChatCompletion({
model: "gpt-3.5-turbo",
messages: [{ role: "user", content: message }],
});
console.log(response);
const { data } = response;
console.log(data);
interaction.editReply(data.choices[0].text || "no response");
interaction.editReply(data.choices[0].message.content || "no response");
} catch (e) {
global.bugsnag.notify(e);
console.log(e);
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"discord.js": "^14.1.2",
"express": "^4.17.1",
"node-cron": "^3.0.0",
"openai": "^3.1.0"
"openai": "^3.2.1"
},
"devDependencies": {
"prettier": "2.7.1",
Expand Down

0 comments on commit e8c4170

Please sign in to comment.