Using previous interactions as context for next request

I’m trying to use the ChatCompletion function in the API to ask multiple questions. For my usecase it is important that GPT uses the previous questions and anwsers as context for it’s next response, similar to chatGPT.

Is it possible to create some kind of chat session where GPT has some memory? Or do I have no other choice than to input all the previous questions and answers in each request?

1 Like

ChatML is both the format you must use to send requests and effectively the session history.

Each response from the assistant should be added to the ChatML array. However, you can try to condense the amount of content in the array to save tokens. How you do that would be situation dependent.