Skip to content

Commit 121d3fd

Browse files
authored
Introduce common/constants.py (#10965)
### What problem does this PR solve? As title. ### Type of change - [x] Refactoring Signed-off-by: Jin Hai <[email protected]>
1 parent d008a4d commit 121d3fd

File tree

4 files changed

+66
-4
lines changed

4 files changed

+66
-4
lines changed

admin/server/admin_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from flask import Flask
2525
from routes import admin_bp
2626
from api.utils.log_utils import init_root_logger
27-
from api.constants import SERVICE_CONF
27+
from common.contants import SERVICE_CONF
2828
from api import settings
2929
from config import load_configurations, SERVICE_CONFIGS
3030
from auth import init_default_admin, setup_auth

api/constants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
IMG_BASE64_PREFIX = "data:image/png;base64,"
1919

20-
SERVICE_CONF = "service_conf.yaml"
21-
2220
API_VERSION = "v1"
2321
RAG_FLOW_SERVICE_NAME = "ragflow"
2422
REQUEST_WAIT_SEC = 2

api/utils/configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from common.file_utils import get_project_base_directory
2727
from filelock import FileLock
2828
from api.utils.common import bytes_to_string, string_to_bytes
29-
from api.constants import SERVICE_CONF
29+
from common.contants import SERVICE_CONF
3030

3131

3232
def conf_realpath(conf_name):

common/contants.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#
2+
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
SERVICE_CONF = "service_conf.yaml"
18+
19+
# environment
20+
# ENV_STRONG_TEST_COUNT = "STRONG_TEST_COUNT"
21+
# ENV_RAGFLOW_SECRET_KEY = "RAGFLOW_SECRET_KEY"
22+
# ENV_REGISTER_ENABLED = "REGISTER_ENABLED"
23+
# ENV_DOC_ENGINE = "DOC_ENGINE"
24+
# ENV_SANDBOX_ENABLED = "SANDBOX_ENABLED"
25+
# ENV_SANDBOX_HOST = "SANDBOX_HOST"
26+
# ENV_MAX_CONTENT_LENGTH = "MAX_CONTENT_LENGTH"
27+
# ENV_COMPONENT_EXEC_TIMEOUT = "COMPONENT_EXEC_TIMEOUT"
28+
# ENV_TRINO_USE_TLS = "TRINO_USE_TLS"
29+
# ENV_MAX_FILE_NUM_PER_USER = "MAX_FILE_NUM_PER_USER"
30+
# ENV_MACOS = "MACOS"
31+
# ENV_RAGFLOW_DEBUGPY_LISTEN = "RAGFLOW_DEBUGPY_LISTEN"
32+
# ENV_WERKZEUG_RUN_MAIN = "WERKZEUG_RUN_MAIN"
33+
# ENV_DISABLE_SDK = "DISABLE_SDK"
34+
# ENV_ENABLE_TIMEOUT_ASSERTION = "ENABLE_TIMEOUT_ASSERTION"
35+
# ENV_LOG_LEVELS = "LOG_LEVELS"
36+
# ENV_TENSORRT_DLA_SVR = "TENSORRT_DLA_SVR"
37+
# ENV_OCR_GPU_MEM_LIMIT_MB = "OCR_GPU_MEM_LIMIT_MB"
38+
# ENV_OCR_ARENA_EXTEND_STRATEGY = "OCR_ARENA_EXTEND_STRATEGY"
39+
# ENV_MAX_CONCURRENT_PROCESS_AND_EXTRACT_CHUNK = "MAX_CONCURRENT_PROCESS_AND_EXTRACT_CHUNK"
40+
# ENV_MAX_MAX_CONCURRENT_CHATS = "MAX_CONCURRENT_CHATS"
41+
# ENV_RAGFLOW_MCP_BASE_URL = "RAGFLOW_MCP_BASE_URL"
42+
# ENV_RAGFLOW_MCP_HOST = "RAGFLOW_MCP_HOST"
43+
# ENV_RAGFLOW_MCP_PORT = "RAGFLOW_MCP_PORT"
44+
# ENV_RAGFLOW_MCP_LAUNCH_MODE = "RAGFLOW_MCP_LAUNCH_MODE"
45+
# ENV_RAGFLOW_MCP_HOST_API_KEY = "RAGFLOW_MCP_HOST_API_KEY"
46+
# ENV_MINERU_EXECUTABLE = "MINERU_EXECUTABLE"
47+
# ENV_MINERU_APISERVER = "MINERU_APISERVER"
48+
# ENV_MINERU_OUTPUT_DIR = "MINERU_OUTPUT_DIR"
49+
# ENV_MINERU_BACKEND = "MINERU_BACKEND"
50+
# ENV_MINERU_DELETE_OUTPUT = "MINERU_DELETE_OUTPUT"
51+
# ENV_TCADP_OUTPUT_DIR = "TCADP_OUTPUT_DIR"
52+
# ENV_LM_TIMEOUT_SECONDS = "LM_TIMEOUT_SECONDS"
53+
# ENV_LLM_MAX_RETRIES = "LLM_MAX_RETRIES"
54+
# ENV_LLM_BASE_DELAY = "LLM_BASE_DELAY"
55+
# ENV_OLLAMA_KEEP_ALIVE = "OLLAMA_KEEP_ALIVE"
56+
# ENV_DOC_BULK_SIZE = "DOC_BULK_SIZE"
57+
# ENV_EMBEDDING_BATCH_SIZE = "EMBEDDING_BATCH_SIZE"
58+
# ENV_MAX_CONCURRENT_TASKS = "MAX_CONCURRENT_TASKS"
59+
# ENV_MAX_CONCURRENT_CHUNK_BUILDERS = "MAX_CONCURRENT_CHUNK_BUILDERS"
60+
# ENV_MAX_CONCURRENT_MINIO = "MAX_CONCURRENT_MINIO"
61+
# ENV_WORKER_HEARTBEAT_TIMEOUT = "WORKER_HEARTBEAT_TIMEOUT"
62+
# ENV_TRACE_MALLOC_ENABLED = "TRACE_MALLOC_ENABLED"
63+
64+

0 commit comments

Comments
 (0)