1
ChatGPT API – How do I handle the 4000 token limit for keeping context?
I am coding a little Discord ChatGPT Bot that I just want to privately use. Right now I just feed the whole message history back to ChatGPT but of course you quite quickly reach the 4000 token limit.
The simplest solution of course would be to just delete the oldest messages but that of course could delete more important messages.
Another idea was that I could let ChatGPT summarise the conversation when I am close to the limit and then only save that message.
Maybe theres already some better implementation that I am not aware of?