Use the add method to add events until the maximum batch size limit in bytes has been reached - at which point a ValueError will be raised.
As per the above statement from official document, the events you have added in batch has exceeded the maximum size limit which is 1 MB.
Make sure that the batch must contain the events' size upto 1MB only.