diff --git a/lightrag/utils.py b/lightrag/utils.py index 657b6953..4a91f229 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -20,6 +20,7 @@ from lightrag.constants import ( DEFAULT_LOG_BACKUP_COUNT, DEFAULT_LOG_FILENAME, GRAPH_FIELD_SEP, + DEFAULT_MAX_TOTAL_TOKENS, DEFAULT_MAX_FILE_PATH_LENGTH, ) @@ -1887,7 +1888,7 @@ async def process_chunks_unified( chunk_token_limit = getattr( query_param, "max_total_tokens", - global_config.get("MAX_TOTAL_TOKENS", 32000), + global_config.get("MAX_TOTAL_TOKENS", DEFAULT_MAX_TOTAL_TOKENS), ) original_count = len(unique_chunks) diff --git a/lightrag_webui/src/components/retrieval/QuerySettings.tsx b/lightrag_webui/src/components/retrieval/QuerySettings.tsx index 28e8dc3d..f5c8cb75 100644 --- a/lightrag_webui/src/components/retrieval/QuerySettings.tsx +++ b/lightrag_webui/src/components/retrieval/QuerySettings.tsx @@ -270,7 +270,7 @@ export default function QuerySettings() { onBlur={(e) => { const value = e.target.value if (value === '' || isNaN(parseInt(value))) { - handleChange('max_total_tokens', 1000) + handleChange('max_total_tokens', 32000) } }} min={1}