We all know we don’t have official sticky session capabilities in any OpenAI APIs yet. Passing previous conversations via system or assistant roles have been suggested in some places, but I didn’t have much luck with this approach. And quickly, you run into token limits for the model. ChatGPT API’s model, GPT-3.5-turbo, has only a 4K token limit compared to Davinchi’s 8K limit.
So I thought I had a clever idea…
Create a prompt that is told to not repeat any prior completion by telling it to generate an MD5 hash of the key part of the competition and then checking against a supplied list of digests that I inject in every subsequent prompt in a JSON format.
But even though it generates the MD5 hash fine and I am able to inject previous hashes fine, it still does not work. I keep getting the same responses.
So I abandoned it. Decided to randomly change the temperature between 0 to 0.5 and got more random responses to the same prompt. But there are still dups.
if you set both to zero you get the opposite: deterministic and therefore always the same responses.
You need to find the sweet spot for yourself. My chatbot had a temperature setting of 0.7 and a top_p of 0.3. This produces reliable answers without being too repetitive.