Pythagora-io / gpt-pilot

The first real AI developer
Other
29.08k stars 2.91k forks source link

Retry when we get a generic LLM API error. #973

Closed gperetin closed 1 month ago

gperetin commented 1 month ago

Ask the user to retry when we get {LLM Provider}.APIerror exception.

senko commented 1 month ago

Reworked the PR so we alway auto-retry up to max retries (3). If that fails, we ask the user if they want to retry again, in which case we again retry up to 3 times, then ask again, etc. If the user declines, we raise APIError which stops Pythagora:

Screenshot from 2024-05-28 20-02-27

(between each of the "do you want to retry" there's 3 retries underneath)

gperetin commented 1 month ago

LGTM, can't merge as it still has me as an author, :ship:

senko commented 1 month ago

@LeonOstrez since Goran and me collaborated on this, it falls to you as an independent party to review :)