Skip to content

Commit d43d663

Browse files
make timeout fail a hyper parameter (#859)
Co-authored-by: Xu Yang <xuyang1@microsoft.com>
1 parent 9765206 commit d43d663

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

rdagent/oai/backend/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def _try_create_chat_completion_or_embedding( # type: ignore[no-untyped-def]
360360
)
361361
):
362362
timeout_count += 1
363-
if timeout_count >= 3:
363+
if timeout_count >= LLM_SETTINGS.timeout_fail_limit:
364364
logger.warning("Timeout error, please check your network connection.")
365365
raise e
366366

rdagent/oai/llm_conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class LLMSettings(ExtendedBaseSettings):
3737
use_embedding_cache: bool = False
3838
prompt_cache_path: str = str(Path.cwd() / "prompt_cache.db")
3939
max_past_message_include: int = 10
40+
timeout_fail_limit: int = 10
4041

4142
# Behavior of returning answers to the same question when caching is enabled
4243
use_auto_chat_cache_seed_gen: bool = False

0 commit comments

Comments
 (0)