π OpenHands: AI-Driven Development
increase the default retries for LLM (#2986)
Xingyao Wang135da0ea2b20
diff --git a/opendevin/core/config.py b/opendevin/core/config.pyindex 74a5d1dd71..cf531ffcc6 100644--- a/opendevin/core/config.py+++ b/opendevin/core/config.py@@ -33,6 +33,7 @@ class LLMConfig:aws_secret_access_key: The AWS secret access key.aws_region_name: The AWS region name.num_retries: The number of retries to attempt.+ retry_multiplier: The multiplier for the exponential backoff.retry_min_wait: The minimum time to wait between retries, in seconds. This is exponential backoff minimum. For models with very low limits, this can be set to 15-20.retry_max_wait: The maximum time to wait between retries, in seconds. This is exponential backoff maximum.timeout: The timeout for the API.@@ -57,9 +58,10 @@ class LLMConfig:aws_access_key_id: str | None = Noneaws_secret_access_key: str | None = Noneaws_region_name: str | None = None- num_retries: int = 5+ num_retries: int = 10+ retry_multiplier: float = 2retry_min_wait: int = 3- retry_max_wait: int = 60+ retry_max_wait: int = 300timeout: int | None = Nonemax_message_chars: int = 10_000 # maximum number of characters in an observation's content when sent to the llmtemperature: float = 0diff --git a/opendevin/llm/llm.py b/opendevin/llm/llm.pyindex c9333a4d02..6fb29a560d 100644--- a/opendevin/llm/llm.py+++ b/opendevin/llm/llm.py@@ -117,7 +117,9 @@ class LLM:reraise=True,stop=stop_after_attempt(config.num_retries),wait=wait_random_exponential(- min=config.retry_min_wait, max=config.retry_max_wait+ multiplier=config.retry_multiplier,+ min=config.retry_min_wait,+ max=config.retry_max_wait,),retry=retry_if_exception_type((