Stateles & sending previous replies, to create a thread

I see a lot of posts on this topic and understand that chatGPT is stateless.

So, essentially, if I want chatGPT to “remember” the previous context, i have to send past messages as well.

  1. Is there a particular way to do this? How do i format it?
  2. And of course, with each message that is concatenated and sent, the token usage goes up, right? :thinking:


I was lazy, sorry, I found the answer after doing some searching

Looking at the solution, it seems pretty obvious in retrospect :man_facepalming:

1 Like

eats up your money very effectively. because after each call, chatgpt “forgets” all the questions, and in order to return it to the final state, the newly born openai.ChatCompletion needs to ask the entire chain of questions again and again! that is, by the 5th question, 1 question will be asked (and paid) 5 times, 2 question - 4 times, etc. What if the dialogue is 20 questions long?! You’ll quickly be left without pants!)))
Why can’t you open one openai.ChatCompletion object at the beginning, and then not ask questions to it sequentially, saving the status? I don’t understand?!
Owners’ greed?


I believe this is what they’re doing with the new Assistants API but I think the cost issue remains but less dev work to maintain state

Do you think that support for state-saving was not foreseen from the very beginning? That is, on GUI of the original openai site, the current model state is not saved in threads, but only the history of questions? which are also re-asked from the very beginning if a person asks a new question in a thread?

Would it be interesting to hear the developers’ response…

Can we close this topic?

Now for a useless sentence to keep the AI happy.

The OP marked this post as the solution before changing it to my post. Most moderators will not mark a post as the solution and I will not for this topic.

As it seems the OP is OK with this topic being closed, will close this topic.