Maintaining the Topic of Dialogue in the API

Hello, could you please tell me if ChatGPT 3.5 Turbo in the API can continue a dialogue without using an Assistant?
I send: ‘You will tell me the population in a city.’
ChatGPT: ‘Okay.’
I send: ‘Paris.’
ChatGPT: ‘[Population of Paris]’
I send: ‘Warsaw.’
ChatGPT: ‘[Population of Warsaw]’

This is needed to save tokens so that there is no need to send the previous part of the dialogue in each question.

Could I get an example of such requests?
Previously, the ‘session_id’ parameter was responsible for this.

Hi!

you just take all the previous outputs and send it to the API again. all of it, every time. Example

step1:

user says: Paris

what you send to the API:

System: The user will provide a city, and you will try your best to guess the population of that city to the best of your knowledge.
User: Paris

API response:

123456

step 2:

user says: Warsaw

what you send to the API:

System: The user will provide a city, and you will try your best to guess the population of that city to the best of your knowledge.
User: Paris
Assistant: 12345
User: Warsaw

API response:

54321

now this might sound like a huge waste, but that’s how LLMs work.