Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
A way to make GPT-3's "davinci" converse with a user(s) through a bot in discord using discord.js?
var collector = new MessageCollector(message.channel, filter, {
    max: 10,
    time: 60000,
})
    start_sequence = "\nAI: "
    
    retart_sequence = "\nHuman: "

        collector.on("collect", (msg) => {
            console.log(msg.content)
            
        openai.Completion.create({
            
            engine: "davinci",
            prompt: msg.content,
            temperature: 0.9,
            max_tokens: 150,
            top_p: 1,
            frequency_penalty: 0.35,
            presence_penalty: 0.6, 
            stop: ["\n", " Human:", " AI:"]  
        
        }).then((response) => {
            
            message.channel.send(response.choices[0].text)
        })

    })
}

I tried this but it only gives back completions, like the default preset rather than the chat preset in GPT-3's "playground". I'm using openai-node to code in javascript rather than python to call openAI API.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your prompt needs to be given more information for GPT-3 to understand what you want. You're providing a prompt of the message, such as

My message!

But what you really should be giving it is something like:

The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.

Human: Hello, who are you?
AI: I am an AI created by OpenAI. How can I help you today?
Human: My message!
AI:

In addition, if you it to be contextually aware, you need to continue adding information to the prompt, such as:

The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.

Human: Hello, who are you?
AI: I am an AI created by OpenAI. How can I help you today?
Human: My message!
AI: Response here
Human: Another message here
AI:

Be aware of the token limits and costs. You may to choose to make it not contextual, or at some point start cutting out previous messages.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda