briansunter / logseq-plugin-gpt3-openai

A plugin for GPT-3 AI assisted note taking in Logseq
https://twitter.com/bsunter
MIT License
717 stars 77 forks source link

Retry on 429 errors and improve error logging #29

Closed briansunter closed 2 years ago

briansunter commented 2 years ago

OpenAI will rate limit you if you call them too often. https://help.openai.com/en/articles/5955598-is-api-usage-subject-to-any-rate-limits

This PR adds exponential backoff so it waits and retries a few times when it sees this error, which is usually enough to resolve the issue.

It also adds improved error logging, and shows the error messages that the OpenAI server is sending.

I need to prevent retrying if it’s a quota error to

briansunter commented 2 years ago

:tada: This PR is included in version 1.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: