Batch API Request: Maintain the context of the conversation

I have several questions that should be answered one after the other. For each question, the answers to all previous questions must be included in the query. How do I need to structure my code?
Thankful for any tips!

This is the structure of my current code:

Question templates

questions_template = […]

Initialize the message context

messages = []

Ask each question in individually

for idx, question in enumerate(questions, 1):

Construct the user content based on the question and its requirement

user_content = [
{“type”: “text”, “text”: “Answer the questions solely based on previous replies and context”},
{“type”: “text”, “text”: question}

Create a task for each question for batch processing

    task = { ...}