mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
fix(llm_config): extend retry delays to respect rate limit windows (#9489)
This commit is contained in:
@@ -57,11 +57,11 @@ class LLMConfig(BaseModel):
|
||||
aws_region_name: str | None = Field(default=None)
|
||||
openrouter_site_url: str = Field(default='https://docs.all-hands.dev/')
|
||||
openrouter_app_name: str = Field(default='OpenHands')
|
||||
# total wait time: 5 + 10 + 20 + 30 = 65 seconds
|
||||
num_retries: int = Field(default=4)
|
||||
retry_multiplier: float = Field(default=2)
|
||||
retry_min_wait: int = Field(default=5)
|
||||
retry_max_wait: int = Field(default=30)
|
||||
# total wait time: 8 + 16 + 32 + 64 = 120 seconds
|
||||
num_retries: int = Field(default=5)
|
||||
retry_multiplier: float = Field(default=8)
|
||||
retry_min_wait: int = Field(default=8)
|
||||
retry_max_wait: int = Field(default=64)
|
||||
timeout: int | None = Field(default=None)
|
||||
max_message_chars: int = Field(
|
||||
default=30_000
|
||||
|
||||
@@ -175,7 +175,7 @@ api_key = "custom-only-api-key"
|
||||
custom_only = default_config.get_llm_config('custom_only')
|
||||
assert custom_only.model == 'custom-only-model'
|
||||
assert custom_only.api_key.get_secret_value() == 'custom-only-api-key'
|
||||
assert custom_only.num_retries == 4 # default value
|
||||
assert custom_only.num_retries == 5 # default value
|
||||
|
||||
|
||||
def test_load_from_toml_llm_invalid_config(
|
||||
|
||||
Reference in New Issue
Block a user