Комментарии:
code doesnt work. it says TypeError: Configuration is not a constructor
const openAPIKey = process.env['OpenAPIKey']
const discrodKey = process.env['DiscrodKey']
const openAiOrg = process.env['OpenAiOrg']
const {Client, GatewayIntentBits } = require('discord.js')
const client = new Client({
intents: [
GatewayIntentBits. Guilds,
GatewayIntentBits. GuildMessages,
GatewayIntentBits.MessageContent
]
})
// Setup OpenAI
const { Configuration, OpenAIApi } = require('openai')
const configuration = new Configuration({
organization: openAiOrg,
apiKey: openAPIKey
})
const openai = new OpenAIApi(configuration)
client.on('messageCreate', async (message) => {
try {
if (message.author.bot) return // Prevents infinite loop
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: message.content,
temperature: 0.9,
max_tokens: 150,
top_p: 1,
frequency_penalty: 0.0,
presence_penalty: 0.6,
stop: ["Human:", "AI:"],
});
message.reply(`${response.data.choices[0].text}`)
} catch (error) {
console.log(error)
}
})
Thats nutty. Thanks for tutorial
ОтветитьIf i want to create a custom chatbot trained with info... what steps should be different to those of the video?
Ответитьabsoulut useless nothing works from that and i wrote everything with my own hands within 12 hours because i can not find the problem he did
ОтветитьNow thats something premium
ОтветитьIt says “error cannot find module ‘openai’ “ I need help I followed everything
ОтветитьNice, but how to add a "keyword" or something like this: [ ! ] or [BOT_NAME]
Without [ ]
I will not follow your ad links and get my own, thanks <3
ОтветитьThanks for exposing The api key ☠️💀
Ответитьhey the replit is pretty much empty
ОтветитьThis was REALLY good, i just needed gPT-4 to help me with some of the code due to syntax errors because it was hard for me to copy and paste everything but overall, amazing job man.
Ответитьthe bot is not 24/7?
Ответитьthere's nothing in it, it's a blank page with installed packages
ОтветитьAre you a Muslim?
ОтветитьI too built a Discord bot with ChatGPT; and gave it the personality of a fictional character...
...and that was a week before this video showed up. 👀👀
How to fix repl process died unexpectedly: exit status 1?
ОтветитьQuestion - can I use my PRO account and not have to pay extra for the API usage??
ОтветитьThank you
Ответитьfrom free version or paid?
Ответитьfinally a good video
Ответитьthe code it is you wrote or ChatGPT on ciscort? sir
ОтветитьI don't know how to run it please help @CleverProgrammer
ОтветитьTalented person...love you Brother ❤
Ответитьcan you make music bot
ОтветитьNice 👍
Ответить