Remove unused code (#3448)

### What problem does this PR solve?

1. Remove unused code.
2. Move some codes from settings to constants

### Type of change

- [x] Refactoring

---------

Signed-off-by: jinhai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2024-11-18 12:05:38 +08:00
committed by GitHub
parent f9643adc43
commit 70cd5c1599
4 changed files with 12 additions and 27 deletions

View File

@ -23,13 +23,10 @@ import rag.utils
from rag.nlp import search
from graphrag import search as kg_search
from api.utils import get_base_config, decrypt_database_config
from api.constants import RAG_FLOW_SERVICE_NAME
API_VERSION = "v1"
RAG_FLOW_SERVICE_NAME = "ragflow"
LIGHTEN = int(os.environ.get('LIGHTEN', "0"))
REQUEST_WAIT_SEC = 2
REQUEST_MAX_WAIT_SEC = 300
LLM = None
LLM_FACTORY = None
LLM_BASE_URL = None
@ -173,15 +170,6 @@ def init_settings():
retrievaler = search.Dealer(docStoreConn)
kg_retrievaler = kg_search.KGSearch(docStoreConn)
def get_host_ip():
global HOST_IP
return HOST_IP
def get_host_port():
global HOST_PORT
return HOST_PORT
class CustomEnum(Enum):
@classmethod
@ -201,16 +189,6 @@ class CustomEnum(Enum):
return [member.name for member in cls.__members__.values()]
class PythonDependenceName(CustomEnum):
Rag_Source_Code = "python"
Python_Env = "miniconda"
class ModelStorage(CustomEnum):
REDIS = "redis"
MYSQL = "mysql"
class RetCode(IntEnum, CustomEnum):
SUCCESS = 0
NOT_EFFECTIVE = 10