mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 13:35:56 +08:00
Remove unused settings (#3427)
### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] Refactoring Signed-off-by: jinhai <haijin.chn@gmail.com>
This commit is contained in:
parent
a1ba228bc2
commit
47abfc32d4
@ -16,7 +16,6 @@
|
|||||||
import os
|
import os
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from enum import IntEnum, Enum
|
from enum import IntEnum, Enum
|
||||||
from api.utils.file_utils import get_project_base_directory
|
|
||||||
import rag.utils.es_conn
|
import rag.utils.es_conn
|
||||||
import rag.utils.infinity_conn
|
import rag.utils.infinity_conn
|
||||||
|
|
||||||
@ -27,23 +26,11 @@ from api.utils import get_base_config, decrypt_database_config
|
|||||||
|
|
||||||
API_VERSION = "v1"
|
API_VERSION = "v1"
|
||||||
RAG_FLOW_SERVICE_NAME = "ragflow"
|
RAG_FLOW_SERVICE_NAME = "ragflow"
|
||||||
SERVER_MODULE = "rag_flow_server.py"
|
|
||||||
TEMP_DIRECTORY = os.path.join(get_project_base_directory(), "temp")
|
|
||||||
RAG_FLOW_CONF_PATH = os.path.join(get_project_base_directory(), "conf")
|
|
||||||
LIGHTEN = int(os.environ.get('LIGHTEN', "0"))
|
LIGHTEN = int(os.environ.get('LIGHTEN', "0"))
|
||||||
|
|
||||||
ERROR_REPORT = True
|
|
||||||
ERROR_REPORT_WITH_PATH = False
|
|
||||||
|
|
||||||
MAX_TIMESTAMP_INTERVAL = 60
|
|
||||||
SESSION_VALID_PERIOD = 7 * 24 * 60 * 60
|
|
||||||
|
|
||||||
REQUEST_TRY_TIMES = 3
|
|
||||||
REQUEST_WAIT_SEC = 2
|
REQUEST_WAIT_SEC = 2
|
||||||
REQUEST_MAX_WAIT_SEC = 300
|
REQUEST_MAX_WAIT_SEC = 300
|
||||||
|
|
||||||
USE_REGISTRY = get_base_config("use_registry")
|
|
||||||
|
|
||||||
LLM = get_base_config("user_default_llm", {})
|
LLM = get_base_config("user_default_llm", {})
|
||||||
LLM_FACTORY = LLM.get("factory", "Tongyi-Qianwen")
|
LLM_FACTORY = LLM.get("factory", "Tongyi-Qianwen")
|
||||||
LLM_BASE_URL = LLM.get("base_url")
|
LLM_BASE_URL = LLM.get("base_url")
|
||||||
@ -115,16 +102,11 @@ if not LIGHTEN:
|
|||||||
EMBEDDING_MDL = default_llm["BAAI"]["embedding_model"] + "@BAAI"
|
EMBEDDING_MDL = default_llm["BAAI"]["embedding_model"] + "@BAAI"
|
||||||
RERANK_MDL = default_llm["BAAI"]["rerank_model"] + "@BAAI"
|
RERANK_MDL = default_llm["BAAI"]["rerank_model"] + "@BAAI"
|
||||||
|
|
||||||
|
|
||||||
API_KEY = LLM.get("api_key", "")
|
API_KEY = LLM.get("api_key", "")
|
||||||
PARSERS = LLM.get(
|
PARSERS = LLM.get(
|
||||||
"parsers",
|
"parsers",
|
||||||
"naive:General,qa:Q&A,resume:Resume,manual:Manual,table:Table,paper:Paper,book:Book,laws:Laws,presentation:Presentation,picture:Picture,one:One,audio:Audio,knowledge_graph:Knowledge Graph,email:Email")
|
"naive:General,qa:Q&A,resume:Resume,manual:Manual,table:Table,paper:Paper,book:Book,laws:Laws,presentation:Presentation,picture:Picture,one:One,audio:Audio,knowledge_graph:Knowledge Graph,email:Email")
|
||||||
|
|
||||||
# distribution
|
|
||||||
DEPENDENT_DISTRIBUTION = get_base_config("dependent_distribution", False)
|
|
||||||
RAG_FLOW_UPDATE_CHECK = False
|
|
||||||
|
|
||||||
HOST = get_base_config(RAG_FLOW_SERVICE_NAME, {}).get("host", "127.0.0.1")
|
HOST = get_base_config(RAG_FLOW_SERVICE_NAME, {}).get("host", "127.0.0.1")
|
||||||
HTTP_PORT = get_base_config(RAG_FLOW_SERVICE_NAME, {}).get("http_port")
|
HTTP_PORT = get_base_config(RAG_FLOW_SERVICE_NAME, {}).get("http_port")
|
||||||
|
|
||||||
@ -132,64 +114,19 @@ SECRET_KEY = get_base_config(
|
|||||||
RAG_FLOW_SERVICE_NAME,
|
RAG_FLOW_SERVICE_NAME,
|
||||||
{}).get("secret_key", str(date.today()))
|
{}).get("secret_key", str(date.today()))
|
||||||
|
|
||||||
TOKEN_EXPIRE_IN = get_base_config(
|
|
||||||
RAG_FLOW_SERVICE_NAME, {}).get(
|
|
||||||
"token_expires_in", 3600)
|
|
||||||
|
|
||||||
NGINX_HOST = get_base_config(
|
|
||||||
RAG_FLOW_SERVICE_NAME, {}).get(
|
|
||||||
"nginx", {}).get("host") or HOST
|
|
||||||
NGINX_HTTP_PORT = get_base_config(
|
|
||||||
RAG_FLOW_SERVICE_NAME, {}).get(
|
|
||||||
"nginx", {}).get("http_port") or HTTP_PORT
|
|
||||||
|
|
||||||
RANDOM_INSTANCE_ID = get_base_config(
|
|
||||||
RAG_FLOW_SERVICE_NAME, {}).get(
|
|
||||||
"random_instance_id", False)
|
|
||||||
|
|
||||||
PROXY = get_base_config(RAG_FLOW_SERVICE_NAME, {}).get("proxy")
|
|
||||||
PROXY_PROTOCOL = get_base_config(RAG_FLOW_SERVICE_NAME, {}).get("protocol")
|
|
||||||
|
|
||||||
DATABASE_TYPE = os.getenv("DB_TYPE", 'mysql')
|
DATABASE_TYPE = os.getenv("DB_TYPE", 'mysql')
|
||||||
DATABASE = decrypt_database_config(name=DATABASE_TYPE)
|
DATABASE = decrypt_database_config(name=DATABASE_TYPE)
|
||||||
|
|
||||||
# Switch
|
|
||||||
# upload
|
|
||||||
UPLOAD_DATA_FROM_CLIENT = True
|
|
||||||
|
|
||||||
# authentication
|
# authentication
|
||||||
AUTHENTICATION_CONF = get_base_config("authentication", {})
|
AUTHENTICATION_CONF = get_base_config("authentication", {})
|
||||||
|
|
||||||
# client
|
# client
|
||||||
CLIENT_AUTHENTICATION = AUTHENTICATION_CONF.get(
|
CLIENT_AUTHENTICATION = AUTHENTICATION_CONF.get(
|
||||||
"client", {}).get(
|
"client", {}).get(
|
||||||
"switch", False)
|
"switch", False)
|
||||||
HTTP_APP_KEY = AUTHENTICATION_CONF.get("client", {}).get("http_app_key")
|
HTTP_APP_KEY = AUTHENTICATION_CONF.get("client", {}).get("http_app_key")
|
||||||
GITHUB_OAUTH = get_base_config("oauth", {}).get("github")
|
GITHUB_OAUTH = get_base_config("oauth", {}).get("github")
|
||||||
FEISHU_OAUTH = get_base_config("oauth", {}).get("feishu")
|
FEISHU_OAUTH = get_base_config("oauth", {}).get("feishu")
|
||||||
WECHAT_OAUTH = get_base_config("oauth", {}).get("wechat")
|
|
||||||
|
|
||||||
# site
|
|
||||||
SITE_AUTHENTICATION = AUTHENTICATION_CONF.get("site", {}).get("switch", False)
|
|
||||||
|
|
||||||
# permission
|
|
||||||
PERMISSION_CONF = get_base_config("permission", {})
|
|
||||||
PERMISSION_SWITCH = PERMISSION_CONF.get("switch")
|
|
||||||
COMPONENT_PERMISSION = PERMISSION_CONF.get("component")
|
|
||||||
DATASET_PERMISSION = PERMISSION_CONF.get("dataset")
|
|
||||||
|
|
||||||
HOOK_MODULE = get_base_config("hook_module")
|
|
||||||
HOOK_SERVER_NAME = get_base_config("hook_server_name")
|
|
||||||
|
|
||||||
ENABLE_MODEL_STORE = get_base_config('enable_model_store', False)
|
|
||||||
# authentication
|
|
||||||
USE_AUTHENTICATION = False
|
|
||||||
USE_DATA_AUTHENTICATION = False
|
|
||||||
AUTOMATIC_AUTHORIZATION_OUTPUT_DATA = True
|
|
||||||
USE_DEFAULT_TIMEOUT = False
|
|
||||||
AUTHENTICATION_DEFAULT_TIMEOUT = 7 * 24 * 60 * 60 # s
|
|
||||||
PRIVILEGE_COMMAND_WHITELIST = []
|
|
||||||
CHECK_NODES_IDENTITY = False
|
|
||||||
|
|
||||||
DOC_ENGINE = os.environ.get('DOC_ENGINE', "elasticsearch")
|
DOC_ENGINE = os.environ.get('DOC_ENGINE', "elasticsearch")
|
||||||
if DOC_ENGINE == "elasticsearch":
|
if DOC_ENGINE == "elasticsearch":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user