IsRetryable determines whether an error from an LLM provider is transient and worth retrying.
(err error)
| 33 | // IsRetryable determines whether an error from an LLM provider is |
| 34 | // transient and worth retrying. |
| 35 | func IsRetryable(err error) bool { |
| 36 | return chaterror.Classify(err).Retryable |
| 37 | } |
| 38 | |
| 39 | // Delay returns the backoff duration for the given 0-indexed attempt. |
| 40 | // Uses exponential backoff: min(InitialDelay * 2^attempt, MaxDelay). |