yoheinakajima / babyagi

MIT License
19.9k stars 2.61k forks source link

More exception handling for OpenAI API errors #187

Closed robiwan303 closed 1 year ago

robiwan303 commented 1 year ago

Adding exception handling for further OpenAI API errors as e.g. timeout or general API error and beautification for the log output in terminal.

Background is that I did observe sporadic runtime errors. The error log did point to "BadGateway" or "GatewayTimeout" in most cases and once or twice "Timeout". With the changes I have far fewer abortions and as a consequence significantly longer (unobserved) runtime for this awesome baby... :-)

Hope this is useful for other people as well. Maybe I am not the only one having such problems.