ChatGPT completion /v1/chat/completions memorize across multiple requests

huangapple go评论59阅读模式
英文:

ChatGPT completion /v1/chat/completions memorize across multiple requests

问题

当我在https://api.openai.com/v1/chat/completions上使用user参数时,记忆不会在多个请求之间保留。我们如何让模型在多个请求之间记住它?

例如,ChatGPT API是否会记住消息"My name is XXX"?还是我每次都必须发送它?那么如果它不用于记忆事物,"user"变量的目的是什么?

{
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "My name is XXX."
}
],
"user": "myuser"
}

英文:

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"
}

答案1

得分: 2

你是说之前的消息被删除了吗?你需要记住它们。API 不会执行删除操作。将 messages 设为变量,并将响应附加到其中。下次发送包含先前响应的 messages 变量。

英文:

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

huangapple
  • 本文由 发表于 2023年4月17日 04:07:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76030084.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定