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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. AZURE = get_base_config("azure", {})
  25. S3 = get_base_config("s3", {})
  26. MINIO = decrypt_database_config(name="minio")
  27. try:
  28. REDIS = decrypt_database_config(name="redis")
  29. except Exception as e:
  30. REDIS = {}
  31. pass
  32. DOC_MAXIMUM_SIZE = int(os.environ.get("MAX_CONTENT_LENGTH", 128 * 1024 * 1024))
  33. # Logger
  34. LoggerFactory.set_directory(
  35. os.path.join(
  36. get_project_base_directory(),
  37. "logs",
  38. "rag"))
  39. # {CRITICAL: 50, FATAL:50, ERROR:40, WARNING:30, WARN:30, INFO:20, DEBUG:10, NOTSET:0}
  40. LoggerFactory.LEVEL = 30
  41. es_logger = getLogger("es")
  42. minio_logger = getLogger("minio")
  43. s3_logger = getLogger("s3")
  44. azure_logger = getLogger("azure")
  45. cron_logger = getLogger("cron_logger")
  46. cron_logger.setLevel(20)
  47. chunk_logger = getLogger("chunk_logger")
  48. database_logger = getLogger("database")
  49. SVR_QUEUE_NAME = "rag_flow_svr_queue"
  50. SVR_QUEUE_RETENTION = 60*60
  51. SVR_QUEUE_MAX_LEN = 1024
  52. SVR_CONSUMER_NAME = "rag_flow_svr_consumer"
  53. SVR_CONSUMER_GROUP_NAME = "rag_flow_svr_consumer_group"