Working on the same dataset for multiple questions

My application is showing the user a dashboard on events and variables found in some textual logs.
This dataset changes each time the user loaded a new set of logs.
I am trying to use the chatGPT3.5 to create a chat in my application, where user can asks questions about the dataset (i.e. how many events of type XYZ occurced within 2 hours).
I have managed to connect and work with the API to get results, however, my issue is this:
since there is no ‘session id’ option, I need to re-send all questions on each API call. that is an issue since the dataset I’m working at is not small (1MB json file), and it seems to be a huge waste to re-send it again and again. not to mentioned costs and tokens limits.

Is there a way to have a session, or upload the file once per ‘chat’?


Model each user as a thread.

Use commands such as : (a) “clear dataset”(b) “upload updated dataset” … to operate on each thread as per user requirement.

Hi, thank you for your answer.
What you are saying is that if I will connect the API with specific user, this user will have a ‘session’ or ‘context’, in a way that any question asked will be asnwered based on the existing dataset that was uploaded?

how can I send the ‘user’ to the request?

this is my current structure:
TalkObject requestBody = new TalkObject()
model = “gpt-3.5-turbo”,
max_tokens = 150,
temperature = 0.7,
messages = messages.ToArray(),
file = _fileID

in addition, I’m sending the ‘regular’ instructions:
messages.Add(new MessageObject()
role = “system”,
content = “You are an AI assistant that helps with questions about the attached dataset”

messages.Add(new MessageObject() { role = “user”, content = question});

are you saying that the ‘user’ can be something else?