I'm trying to make an app that runs text-based adventure games using a GPT-3.5 chat bot as a storyteller. I've got it accepting sets of rules for games, characters, and creatures through JSON files so it can keep referencing these rules without taking up token space as "memory". However, I keep hitting the token limit. I want to be able to truncate old tokens as the conversation/game continues. So far, no attempt I've made on my own or any provided by ChatGPT seem to work correctly, and the games keep crashing as I hit the token cap.
I am happy to provide the code for troubleshooting purposes if needed.