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.4KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. DOC_MAXIMUM_SIZE = 64 * 1024 * 1024
  26. # Logger
  27. LoggerFactory.set_directory(os.path.join(get_project_base_directory(), "logs", "rag"))
  28. # {CRITICAL: 50, FATAL:50, ERROR:40, WARNING:30, WARN:30, INFO:20, DEBUG:10, NOTSET:0}
  29. LoggerFactory.LEVEL = 10
  30. es_logger = getLogger("es")
  31. minio_logger = getLogger("minio")
  32. cron_logger = getLogger("cron_logger")
  33. chunk_logger = getLogger("chunk_logger")