1

When I use user parameter on https://api.openai.com/v1/chat/completions, the memory is not persisted across multiple requests. How can we let the model memorize it across multiple requests?

Eg. is the message "My name is XXX" remembered by the ChatGPT API? Or do I have to send it every time? Then what is the purpose of the "user" variable if it is not used to remember things?

{
    "model": "gpt-4",
    "messages": [
        {
            "role": "user",
            "content": "My name is XXX."
        }
    ],
    "user": "myuser"
}
angelokh
  • 9,426
  • 9
  • 69
  • 139

1 Answers1

2

Do you mean that previous messages are deleted? You'll have to remember them. The API doesn't do that. Make messages a variable and append the response to it. Next time send the messages variable which contains the previous response

Antosser
  • 346
  • 1
  • 9
  • I mean the message "My name is XXX" is remembered by the ChatGPT API? Or do I have to send it every time? Then what is the purpose of "user" variable if it is not used to remember things? – angelokh Apr 17 '23 at 00:28
  • But what if the context is too big? I assume the messages or API requests should have an upper limit? – angelokh Apr 17 '23 at 00:47
  • It does, but you can't do anything about it – Antosser Apr 18 '23 at 13:47