You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

settings.py 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Copyright 2024 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. import os
  17. from api.utils import get_base_config, decrypt_database_config
  18. from api.utils.file_utils import get_project_base_directory
  19. from api.utils.log_utils import LoggerFactory, getLogger
  20. # Server
  21. RAG_CONF_PATH = os.path.join(get_project_base_directory(), "conf")
  22. SUBPROCESS_STD_LOG_NAME = "std.log"
  23. ES = get_base_config("es", {})
  24. MINIO = decrypt_database_config(name="minio")
  25. try:
  26. REDIS = decrypt_database_config(name="redis")
  27. except Exception as e:
  28. REDIS = {}
  29. pass
  30. DOC_MAXIMUM_SIZE = int(os.environ.get("MAX_CONTENT_LENGTH", 128 * 1024 * 1024))
  31. # Logger
  32. LoggerFactory.set_directory(
  33. os.path.join(
  34. get_project_base_directory(),
  35. "logs",
  36. "rag"))
  37. # {CRITICAL: 50, FATAL:50, ERROR:40, WARNING:30, WARN:30, INFO:20, DEBUG:10, NOTSET:0}
  38. LoggerFactory.LEVEL = 30
  39. es_logger = getLogger("es")
  40. minio_logger = getLogger("minio")
  41. cron_logger = getLogger("cron_logger")
  42. cron_logger.setLevel(20)
  43. chunk_logger = getLogger("chunk_logger")
  44. database_logger = getLogger("database")
  45. SVR_QUEUE_NAME = "rag_flow_svr_queue"
  46. SVR_QUEUE_RETENTION = 60*60
  47. SVR_QUEUE_MAX_LEN = 1024
  48. SVR_CONSUMER_NAME = "rag_flow_svr_consumer"
  49. SVR_CONSUMER_GROUP_NAME = "rag_flow_svr_consumer_group"