Skip to content

Commit d68c226

Browse files
committed
Increase retry interval and add overloaded error to retry statuses
1 parent 61bd541 commit d68c226

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/ruby_llm/provider.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module RubyLLM
77
module Provider
88
# Common functionality for all LLM providers. Implements the core provider
99
# interface so specific providers only need to implement a few key methods.
10-
module Methods
10+
module Methods # rubocop:disable Metrics/ModuleLength
1111
extend Streaming
1212

1313
def complete(messages, tools:, temperature:, model:, &block) # rubocop:disable Metrics/MethodLength
@@ -108,7 +108,7 @@ def connection # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
108108

109109
f.request :retry, {
110110
max: RubyLLM.config.max_retries,
111-
interval: 0.05,
111+
interval: 0.1,
112112
interval_randomness: 0.5,
113113
backoff_factor: 2,
114114
exceptions: [
@@ -119,9 +119,10 @@ def connection # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
119119
Faraday::RetriableResponse,
120120
RubyLLM::RateLimitError,
121121
RubyLLM::ServerError,
122-
RubyLLM::ServiceUnavailableError
122+
RubyLLM::ServiceUnavailableError,
123+
RubyLLM::OverloadedError
123124
],
124-
retry_statuses: [429, 500, 502, 503, 504]
125+
retry_statuses: [429, 500, 502, 503, 504, 529]
125126
}
126127

127128
f.request :json

0 commit comments

Comments
 (0)