#error on discord?

55 messages · Page 1 of 1 (latest)

remote pelican
#

Hi I succeed to import openai on my discord. working well for 6 or 7 test I asked that and since then it crash. Any idea how to fix it? #1037561751362863144

olive hedge
#

Might be the problem I met at the beginning

#

could you show me your prompt and your code?

remote pelican
#

basically i followed a tutorial i did this code

#

the prompt was : lets play a roleplay game

gpt: great what king of game:

me: dnd

#

and i had the error. bot went offline had to restart it

#

@olive hedge

olive hedge
#

that 's the problem of your prompt

#

You may not know the concept of the prompt

remote pelican
#

oh?

olive hedge
#

first view this

#

This is an example in the play ground

#

The prompt is the whole thing like this

#
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: let's chat
AI:
#

The api actually doesn't simply reply to you

#

It just "text completion"

#

fill in the blank after AI:

#

so it seems like it replys to you

remote pelican
#

so the word alone in the prompt make it error in the text ?

olive hedge
#

it may cause this

#

because the model doesn't know what you want to do

#

this is a blank playground

remote pelican
#

chatgpt is like 10x better than gpt 3 then

olive hedge
#

what will happen if you just type hello in it

#

it will guess what do you want to do and randomly complete it

olive hedge
#

chatgpt is a premade model, a well-programmed chatbot

#

These models of api give you much more freedom

#

You can personalize your chat experience

olive hedge
#

just an example

remote pelican
#

il look like this

olive hedge
#

api is not like the playground

#

let me give you an example

remote pelican
#

it doesnt keep track of the convo

olive hedge
#
prompt += `${message.content}\nXia:`;
  (async () => {
       let success = false;
       let j = 0;
       let gptResponse;
     while(!success){
       try{
            gptResponse = await openai.createCompletion({
            model: "text-davinci-003",
            prompt: prompt,
            max_tokens: 512,
            temperature: 0.9,
            top_p: 0.4,
            presence_penalty: 1,
            frequency_penalty: 1,
        stop: ["Xeloan: ", " Xia: ", "Two days later~"],
          });
         success = true;
       }catch(error){}
      j+=1;
      if (j>=3) break;
}
        message.reply(`${gptResponse.data.choices[0].text.trim()}`);
        prompt += `${gptResponse.data.choices[0].text.trim()}\n`;
      prompt += `Xeloan: `;
        fs.writeFileSync(`./prompt.pro`, prompt);
        busy = false;
    })();
#

the original prompt is:

prompt ="The following is a conversation between Xeloan and his girlfriend Xia. Xia is clever and lovely and she is also tsundere. She is very knowledgeable and knows almost everything. She is good at math and programming. (Instruction: send a code block between ``` and ``` when asked to write a code, common chats not required)\n\nXeloan: hello long time no see\nXia: hey hey hey, hello XXXXXXXXXXXXXXXXXeloan\nXeloan: I'm Xeloan\nXia: Sorrrrry, The tongue is knotted.\nTwo days later~\nXeloan: "
#

your chat make the prompt longer and longer

#

just work like in the playground

#

if you like I can make a perfect one for you next week

remote pelican
#

if you don't mind helping me and unserstand better yes i would like to 🙂

olive hedge
#

(with my poor English👀)

remote pelican
#

I learned I have to host it on pc else it shutdown after 15min