replicate / replicate-go

Go client for Replicate
https://replicate.com
Apache License 2.0
65 stars 9 forks source link

Add automatic retry policy #12

Closed mattt closed 1 year ago

mattt commented 1 year ago

This PR introduces behavior to automatically retry them as appropriate (429 status code, as well as 5xx errors for GET requests). If the server sends a Retry-After header, that value is used. Otherwise, the function delays for the duration specified by the configured backoff strategy.

This should all be in line with the retry logic in the Python client.