How to simulate the gpt4-o response approach

Dears,

I am developing a GENAI application using openai Api(using gpt4-o) ,
how to have a technical solution to give long responses greater than 4096 similar to what we see on chatgpt4-o web interface; it gives long long answers

regards,
Omran

Just send everything again, including what it just responded. It will continue in the next message. However, I have sometime trouble that it might repeat the previous line or words instead of continuing exactly where it left off.

Thanks Torronen…
I did get the point exactly ;;can you give more clarification

BR
Omran

First, you would send message like this:
USER: Write an article about A.I.

Then A.I. will respons but the response cuts in middle after 4095 tokens
USER: Write an article about A.I.
AGENT: […] and the most important thing is

Now, we send
USER: Write an article about A.I.
AGENT: […] and the most important thing is

So, A.I. should respond
USER: Write an article about A.I.
AGENT: […] and the most important thing is
AGENT: to know what kind of algorithm is needed. That is the end of this article.