|
33 | 33 | DEFAULT_RELATED_CHUNK_NUMBER, |
34 | 34 | DEFAULT_MIN_RERANK_SCORE, |
35 | 35 | DEFAULT_SUMMARY_MAX_TOKENS, |
| 36 | + DEFAULT_MAX_ASYNC, |
| 37 | + DEFAULT_MAX_PARALLEL_INSERT, |
| 38 | + DEFAULT_MAX_GRAPH_NODES, |
36 | 39 | ) |
37 | 40 | from lightrag.utils import get_env_value |
38 | 41 |
|
@@ -283,7 +286,9 @@ class LightRAG: |
283 | 286 | ) |
284 | 287 | """Maximum number of tokens allowed per LLM response.""" |
285 | 288 |
|
286 | | - llm_model_max_async: int = field(default=int(os.getenv("MAX_ASYNC", 4))) |
| 289 | + llm_model_max_async: int = field( |
| 290 | + default=int(os.getenv("MAX_ASYNC", DEFAULT_MAX_ASYNC)) |
| 291 | + ) |
287 | 292 | """Maximum number of concurrent LLM calls.""" |
288 | 293 |
|
289 | 294 | llm_model_kwargs: dict[str, Any] = field(default_factory=dict) |
@@ -315,10 +320,14 @@ class LightRAG: |
315 | 320 | # Extensions |
316 | 321 | # --- |
317 | 322 |
|
318 | | - max_parallel_insert: int = field(default=int(os.getenv("MAX_PARALLEL_INSERT", 2))) |
| 323 | + max_parallel_insert: int = field( |
| 324 | + default=int(os.getenv("MAX_PARALLEL_INSERT", DEFAULT_MAX_PARALLEL_INSERT)) |
| 325 | + ) |
319 | 326 | """Maximum number of parallel insert operations.""" |
320 | 327 |
|
321 | | - max_graph_nodes: int = field(default=get_env_value("MAX_GRAPH_NODES", 1000, int)) |
| 328 | + max_graph_nodes: int = field( |
| 329 | + default=get_env_value("MAX_GRAPH_NODES", DEFAULT_MAX_GRAPH_NODES, int) |
| 330 | + ) |
322 | 331 | """Maximum number of graph nodes to return in knowledge graph queries.""" |
323 | 332 |
|
324 | 333 | addon_params: dict[str, Any] = field( |
|
0 commit comments