Duplicate responce

Hey, everybody!

I have a problem persists, I have an aggregator that aggregates a user’s messages into an array in a unit of time and passes it to chatgpt. And it first message passes further to telegram for the user to get a reply. But then on the second message that was in the array also gives the user a reply. And everything is logged as one reply.
What can I do with this and how can I make a user receive one response for a group of his messages?
According to my observations: for some reason chatgpt for the second time prepares a response to the second message that was in the array, how does this happen, how to make it not be answered if it is already in the array?

Who has encountered such a problem, please advise, already tried different options and found nothing in the documentation on this issue.

Hey, everybody!

No one knows how to solve this?