diff --git a/.env.example b/.env.example index 2b5c284c..835c1479 100644 --- a/.env.example +++ b/.env.example @@ -26,7 +26,7 @@ ### Max async calls for LLM # MAX_ASYNC=4 ### Optional Timeout for LLM -# TIMEOUT=None # Time out in seconds, None for infinite timeout +# TIMEOUT=150 # Time out in seconds, None for infinite timeout ### Settings for RAG query # HISTORY_TURNS=3 diff --git a/lightrag/api/README.md b/lightrag/api/README.md index d06a8d9e..86f18271 100644 --- a/lightrag/api/README.md +++ b/lightrag/api/README.md @@ -268,7 +268,7 @@ You can not change storage implementation selection after you add documents to L | --input-dir | ./inputs | Directory containing input documents | | --max-async | 4 | Maximum async operations | | --max-tokens | 32768 | Maximum token size | -| --timeout | None | Timeout in seconds (useful when using slow AI). Use None for infinite timeout | +| --timeout | 150 | Timeout in seconds. None for infinite timeout(not recommended) | | --log-level | INFO | Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) | | --verbose | - | Verbose debug output (True, Flase) | | --key | None | API key for authentication. Protects lightrag server against unauthorized access | diff --git a/lightrag/api/utils_api.py b/lightrag/api/utils_api.py index e32cdc41..a78a6e93 100644 --- a/lightrag/api/utils_api.py +++ b/lightrag/api/utils_api.py @@ -148,6 +148,8 @@ def parse_args() -> argparse.Namespace: ) def timeout_type(value): + if value is None: + return 150 if value is None or value == "None": return None return int(value)