make timeout fail a hyper parameter (#859)

Co-authored-by: Xu Yang <xuyang1@microsoft.com>
This commit is contained in:
Xu Yang
2025-05-08 21:30:44 +08:00
committed by GitHub
parent 6fbe213f3d
commit 5fecefb802
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -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