How to summarize API call?

Please don’t post screenshots of code, unless you use Photoshop to write your programs.

Copy and paste the code into your post as text, formatted correctly.

I presume you mean that the code splits up the document you have read into chunks.

I think you need to ask the ChatGPT people how you can overcome the 2000 character limit on their API. This is not a Python problem, it is a ChatGPT problem and has absolutely nothing to do with Python.

Maybe you could ask ChatGPT how to use the ChatGPT API to summarise a 6000 word document?

Or maybe you could ask for the main three points (not ten) of the first and last chunk, and the main four points of the middle chunk. That will give you ten points altogether.

Or you could get the 30 main points from the three chunks and pass them back to ChatGPT and ask it to summarise those 30 points into 10.