Looking at the code, it looks like you're maintaining context by re-serializing all previous responses as "ChatGPT" and "User." Out of curiosity, do you know that this is how chatgpt is done, or your take on it? I assumed from this tweet, there was more of a "special sauce" for maintaining chat context:
https://twitter.com/OpenAI/status/1615160228366147585?s=20&t...