so i have been using dav. 03 for a while and i wanted to change to the newest version of gpt turbo, since the gpt-4 isnt public yet. unfortunately there are not so many articles about this, and i was hoping that someone could help me change the model without loosing any features.
code:```default:
try {
const userId = message.author.id;
const userHistory = conversationHistory[userId] || [];
const botId = client.user.id;
const prompt = "input: " + "\nContext: " + userHistory.join("\n") + message.content + "\nOutput:";
var completion;
(async () => {
completion = await openai.createCompletion({
model: "text-davinci-003",
prompt,
max_tokens: 1024
},
{
timeout: 10000,
headers: {
"Example-Header": "example",
}
});
const response = completion.data.choices[0].text.trim();
message.channel.send("```" + response + "```");
userHistory.push("Bot: " + response);
userHistory.push(message.content);
userHistory.push(response);
conversationHistory[userId] = userHistory;
})();
} catch (error) {
if (error.response) {
console.log(error.response.status);
console.log(error.response.data);
} else {
console.log(error.message);
message.channel.send(error.message);
}
}
break; ```
The code is in javascript btw