Have you heard of SillyTavern? If you have an OpenAI API key, you can let SillyTavern handle the the structure of the conversation so that GPT is “in the loop”. Looking at the messages SillyTavern sends during a conversation can give some really good insight into how the chat completion endpoint can be used to maintain a consistent character persona (for a reasonable amount of time). If you have any questions, I could send you some links.