mikavehns / BookGPT

Writes complete books with given paramters, using GPT-3.
MIT License
353 stars 66 forks source link

Rate limit reached #12

Closed mrkrisification closed 1 year ago

mrkrisification commented 1 year ago

Describe the bug When running the application it runs into exceeding the openai rate limit. This happens on the free plan (with 18 USD grant). It's also not clear at which point precisely it breaks off, and which limit precisely is exceeded. In one try it ended after 4 requests using 1746 tokens, and on the 2nd try it ran for 10 requests and 4186 tokens.

To Reproduce Steps to reproduce the behavior: Start a new book. (on a free plan) The book should have had 5 chapters with 300 words each in english. Start creation of the book Wait for the error to be thrown

Expected behavior Catching the Exception, and "slowing down" the requests / avoid exceeding the rate limit.

Desktop (please complete the following information):

Additional context Thanks for the Project! I am working on something similar, trying to have GPT write longer fiction stories. Still did not figure out, how to keep it close to the "story"line.

mikavehns commented 1 year ago

Thank you for reporting this issue! The program has been designed with a retry mechanism that attempts to complete each request up to 5 times. If it fails after these attempts, the program will automatically quit as it is an indication that the server is experiencing an overload and further attempts would not yield a positive outcome.