#Chat Bot using GPT API does not "continue"

10 messages · Page 1 of 1 (latest)

floral prairie
#

Since I had problems using ChatGPT (see channel "chatgpt_bugs) I tried out to programm a discord Chatbot using the API following a tutorial using nodejs. I have succesfully communicated with text-davinci-003 API and received suitable answers. However there is no context between the answers and the AI seems to not remember its previous answers. Therefore it is not possible to reference a new promt to an already given topic (f.e. improving/changing code snippets that where received by the API before). Also the "continue" prompt does not work for the same reasons and sometimes the answer continues to a completely different topic than intendet....

This Problem also persists on very easy/uncomplicated prompts...

Any Ideas how to fix this and get similar behavior like on the original ChatGPT site?

Thanks in advance!

floral prairie
#

It seems like it is somewhat working sometimes but right the next time it is completely off again . this is the function that is asking for the Completion:

    const completion = await openai.createCompletion({
        model: "text-davinci-003",
        prompt: message,
        temperature: 0.06,
        max_tokens: 1500,
        top_p: 1,
        frequency_penalty: 0,
        presence_penalty: 0,
    });
    return completion.data.choices[0].text;
} ```
forest gust
#

HI

floral prairie
#

Hey there. Does anyone can help here?

granite zinc
#

Hello, The API won't remember your previous answers unless you add them to the prompt, here's a python script that can do that for you. I'm not super familiar with nodejs but you can probably adapt it


# Set the API key
openai.api_key = "YOURKEY"
model_engine = "text-davinci-003"

name = "Josh" #Users name
Chat = [] #This is where the conversation is stored so it can be fed back in to the prompt

while(True):
  print("Please enter a prompt")  #ask the user to input thier response, this can be removed
  Chat.append(name + ": "+input() + "\n") #add the users name to the conversation memory
  prompt = ("".join(Chat))  #convert the conversation to a string so it can be sent as a prompt

  completions = openai.Completion.create(engine=model_engine, prompt=prompt, max_tokens=1024,temperature=0.5) #Send the prompt to the language model and get the response

  response = completions.choices[0].text  #Get the response from completions
  Chat.append("Computer: " + response + "\n") #add the response to our conversation array
  print(response) #print the response```
#

an extra warning that you'll be sending the whole conversation every time you talk to the bot which will use more tokens

opaque moat
#

that because it isnt chat gpt its open ai api

keen heath
#

so with chatgpt api how can we do it

#

what we shoudl use @opaque moat

#

when i searchchatgpt api ist showing open ai api