andrewgcodes/lightspeedGPT — reverse-engineered prompt
Reverse engineered prompt
Build me a simple Python tool that can take a really large text file, like a book or long report, and run an OpenAI prompt over the whole thing even if it is too big for one request.
I want it to split the file into safe sized chunks, send several chunks at the same time so it runs faster, then collect all the answers into one output file. It should work for things like translating a long document, summarizing a textbook piece by piece, or extracting names and places from a big file.
Make it usable from the command line with options for input file, output file, log file, model, chunk size, max response tokens, temperature, and the prompt to apply. Read the OpenAI API key from an environment variable. If the API rate limit or a temporary error happens, retry with exponential backoff and some randomness, then give up after a few failed attempts.
Include a small example input file, requirements, and clear README instructions.
Want more depth? Deep Reverse