diff --git a/rdagent/oai/backend/base.py b/rdagent/oai/backend/base.py index e66d8e65..f00a568e 100644 --- a/rdagent/oai/backend/base.py +++ b/rdagent/oai/backend/base.py @@ -360,7 +360,7 @@ class APIBackend(ABC): ) ): timeout_count += 1 - if timeout_count >= 3: + if timeout_count >= LLM_SETTINGS.timeout_fail_limit: logger.warning("Timeout error, please check your network connection.") raise e diff --git a/rdagent/oai/llm_conf.py b/rdagent/oai/llm_conf.py index a3ecf83e..8e36249a 100644 --- a/rdagent/oai/llm_conf.py +++ b/rdagent/oai/llm_conf.py @@ -37,6 +37,7 @@ class LLMSettings(ExtendedBaseSettings): use_embedding_cache: bool = False prompt_cache_path: str = str(Path.cwd() / "prompt_cache.db") max_past_message_include: int = 10 + timeout_fail_limit: int = 10 # Behavior of returning answers to the same question when caching is enabled use_auto_chat_cache_seed_gen: bool = False