2023-05-15 08:51:32 +08:00
|
|
|
import os
|
|
|
|
|
|
|
|
import dotenv
|
|
|
|
|
|
|
|
DEFAULTS = {
|
|
|
|
'DB_USERNAME': 'postgres',
|
|
|
|
'DB_PASSWORD': '',
|
|
|
|
'DB_HOST': 'localhost',
|
|
|
|
'DB_PORT': '5432',
|
|
|
|
'DB_DATABASE': 'dify',
|
2023-12-08 13:22:04 +08:00
|
|
|
'DB_CHARSET': '',
|
2024-06-14 15:19:59 +08:00
|
|
|
'S3_USE_AWS_MANAGED_IAM': 'False',
|
2024-03-26 10:18:26 +08:00
|
|
|
'S3_ADDRESS_STYLE': 'auto',
|
2024-05-15 15:27:15 +08:00
|
|
|
'SQLALCHEMY_DATABASE_URI_SCHEME': 'postgresql',
|
2023-05-15 08:51:32 +08:00
|
|
|
'SQLALCHEMY_POOL_SIZE': 30,
|
2024-04-08 18:51:46 +08:00
|
|
|
'SQLALCHEMY_MAX_OVERFLOW': 10,
|
2023-08-12 00:57:00 +08:00
|
|
|
'SQLALCHEMY_POOL_RECYCLE': 3600,
|
2024-05-16 17:07:21 +08:00
|
|
|
'SQLALCHEMY_POOL_PRE_PING': 'False',
|
2023-05-15 08:51:32 +08:00
|
|
|
'SQLALCHEMY_ECHO': 'False',
|
|
|
|
'WEAVIATE_GRPC_ENABLED': 'True',
|
2023-06-13 14:49:40 +08:00
|
|
|
'WEAVIATE_BATCH_SIZE': 100,
|
2024-01-04 10:58:47 +08:00
|
|
|
'QDRANT_CLIENT_TIMEOUT': 20,
|
2024-04-28 15:33:32 +08:00
|
|
|
'QDRANT_GRPC_ENABLED': 'False',
|
2024-04-29 15:28:34 +08:00
|
|
|
'QDRANT_GRPC_PORT': '6334',
|
2023-05-15 08:51:32 +08:00
|
|
|
'CELERY_BACKEND': 'database',
|
2023-08-12 00:57:00 +08:00
|
|
|
'HOSTED_OPENAI_QUOTA_LIMIT': 200,
|
2024-01-17 15:02:27 +08:00
|
|
|
'HOSTED_OPENAI_TRIAL_ENABLED': 'False',
|
2024-02-23 16:48:58 +08:00
|
|
|
'HOSTED_OPENAI_TRIAL_MODELS': 'gpt-3.5-turbo,gpt-3.5-turbo-1106,gpt-3.5-turbo-instruct,gpt-3.5-turbo-16k,gpt-3.5-turbo-16k-0613,gpt-3.5-turbo-0613,gpt-3.5-turbo-0125,text-davinci-003',
|
2023-08-12 00:57:00 +08:00
|
|
|
'HOSTED_OPENAI_PAID_ENABLED': 'False',
|
2024-04-10 22:55:46 +08:00
|
|
|
'HOSTED_OPENAI_PAID_MODELS': 'gpt-4,gpt-4-turbo-preview,gpt-4-turbo-2024-04-09,gpt-4-1106-preview,gpt-4-0125-preview,gpt-3.5-turbo,gpt-3.5-turbo-16k,gpt-3.5-turbo-16k-0613,gpt-3.5-turbo-1106,gpt-3.5-turbo-0613,gpt-3.5-turbo-0125,gpt-3.5-turbo-instruct,text-davinci-003',
|
2023-08-12 00:57:00 +08:00
|
|
|
'HOSTED_AZURE_OPENAI_ENABLED': 'False',
|
|
|
|
'HOSTED_AZURE_OPENAI_QUOTA_LIMIT': 200,
|
2023-08-17 16:56:20 +08:00
|
|
|
'HOSTED_ANTHROPIC_QUOTA_LIMIT': 600000,
|
2024-01-17 15:02:27 +08:00
|
|
|
'HOSTED_ANTHROPIC_TRIAL_ENABLED': 'False',
|
2023-08-12 00:57:00 +08:00
|
|
|
'HOSTED_ANTHROPIC_PAID_ENABLED': 'False',
|
2023-09-12 10:26:12 +08:00
|
|
|
'HOSTED_MODERATION_ENABLED': 'False',
|
|
|
|
'HOSTED_MODERATION_PROVIDERS': '',
|
2024-04-08 18:51:46 +08:00
|
|
|
'HOSTED_FETCH_APP_TEMPLATES_MODE': 'remote',
|
|
|
|
'HOSTED_FETCH_APP_TEMPLATES_REMOTE_DOMAIN': 'https://tmpl.dify.ai',
|
2024-04-09 15:39:36 +08:00
|
|
|
'MILVUS_DATABASE': 'default',
|
2023-05-15 08:51:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def get_env(key):
|
|
|
|
return os.environ.get(key, DEFAULTS.get(key))
|
|
|
|
|
|
|
|
|
|
|
|
def get_bool_env(key):
|
2024-01-17 15:02:27 +08:00
|
|
|
value = get_env(key)
|
|
|
|
return value.lower() == 'true' if value is not None else False
|
2023-05-15 08:51:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
def get_cors_allow_origins(env, default):
|
|
|
|
cors_allow_origins = []
|
|
|
|
if get_env(env):
|
|
|
|
for origin in get_env(env).split(','):
|
|
|
|
cors_allow_origins.append(origin)
|
|
|
|
else:
|
|
|
|
cors_allow_origins = [default]
|
|
|
|
|
|
|
|
return cors_allow_origins
|
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
"""Application configuration class."""
|
|
|
|
|
|
|
|
def __init__(self):
|
2024-06-19 13:41:12 +08:00
|
|
|
dotenv.load_dotenv()
|
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
self.TESTING = False
|
2024-04-18 17:33:32 +08:00
|
|
|
|
2023-11-13 22:05:46 +08:00
|
|
|
# cors settings
|
|
|
|
self.CONSOLE_CORS_ALLOW_ORIGINS = get_cors_allow_origins(
|
2024-06-19 13:41:12 +08:00
|
|
|
'CONSOLE_CORS_ALLOW_ORIGINS', get_env('CONSOLE_WEB_URL'))
|
2023-11-13 22:05:46 +08:00
|
|
|
self.WEB_API_CORS_ALLOW_ORIGINS = get_cors_allow_origins(
|
|
|
|
'WEB_API_CORS_ALLOW_ORIGINS', '*')
|
|
|
|
|
|
|
|
# ------------------------
|
|
|
|
# Database Configurations.
|
|
|
|
# ------------------------
|
|
|
|
db_credentials = {
|
|
|
|
key: get_env(key) for key in
|
2023-12-08 13:13:21 +08:00
|
|
|
['DB_USERNAME', 'DB_PASSWORD', 'DB_HOST', 'DB_PORT', 'DB_DATABASE', 'DB_CHARSET']
|
2023-11-13 22:05:46 +08:00
|
|
|
}
|
2024-05-15 15:27:15 +08:00
|
|
|
self.SQLALCHEMY_DATABASE_URI_SCHEME = get_env('SQLALCHEMY_DATABASE_URI_SCHEME')
|
2023-11-13 22:05:46 +08:00
|
|
|
|
2023-12-08 13:22:04 +08:00
|
|
|
db_extras = f"?client_encoding={db_credentials['DB_CHARSET']}" if db_credentials['DB_CHARSET'] else ""
|
|
|
|
|
2024-05-15 15:27:15 +08:00
|
|
|
self.SQLALCHEMY_DATABASE_URI = f"{self.SQLALCHEMY_DATABASE_URI_SCHEME}://{db_credentials['DB_USERNAME']}:{db_credentials['DB_PASSWORD']}@{db_credentials['DB_HOST']}:{db_credentials['DB_PORT']}/{db_credentials['DB_DATABASE']}{db_extras}"
|
2023-11-13 22:05:46 +08:00
|
|
|
self.SQLALCHEMY_ENGINE_OPTIONS = {
|
|
|
|
'pool_size': int(get_env('SQLALCHEMY_POOL_SIZE')),
|
2024-04-08 18:51:46 +08:00
|
|
|
'max_overflow': int(get_env('SQLALCHEMY_MAX_OVERFLOW')),
|
2024-05-16 17:07:21 +08:00
|
|
|
'pool_recycle': int(get_env('SQLALCHEMY_POOL_RECYCLE')),
|
2024-05-25 13:11:18 +08:00
|
|
|
'pool_pre_ping': get_bool_env('SQLALCHEMY_POOL_PRE_PING'),
|
|
|
|
'connect_args': {'options': '-c timezone=UTC'},
|
2023-11-13 22:05:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
self.SQLALCHEMY_ECHO = get_bool_env('SQLALCHEMY_ECHO')
|
|
|
|
|
|
|
|
# ------------------------
|
|
|
|
# Celery worker Configurations.
|
|
|
|
# ------------------------
|
|
|
|
self.CELERY_BROKER_URL = get_env('CELERY_BROKER_URL')
|
|
|
|
self.CELERY_BACKEND = get_env('CELERY_BACKEND')
|
|
|
|
self.CELERY_RESULT_BACKEND = 'db+{}'.format(self.SQLALCHEMY_DATABASE_URI) \
|
|
|
|
if self.CELERY_BACKEND == 'database' else self.CELERY_BROKER_URL
|
2024-06-19 13:41:12 +08:00
|
|
|
self.BROKER_USE_SSL = self.CELERY_BROKER_URL.startswith('rediss://') if self.CELERY_BROKER_URL else False
|
2023-11-13 22:05:46 +08:00
|
|
|
|
2024-06-05 00:13:04 +08:00
|
|
|
|
|
|
|
# S3 Storage settings
|
2024-06-14 15:19:59 +08:00
|
|
|
self.S3_USE_AWS_MANAGED_IAM = get_bool_env('S3_USE_AWS_MANAGED_IAM')
|
2023-05-15 08:51:32 +08:00
|
|
|
self.S3_ENDPOINT = get_env('S3_ENDPOINT')
|
|
|
|
self.S3_BUCKET_NAME = get_env('S3_BUCKET_NAME')
|
|
|
|
self.S3_ACCESS_KEY = get_env('S3_ACCESS_KEY')
|
|
|
|
self.S3_SECRET_KEY = get_env('S3_SECRET_KEY')
|
|
|
|
self.S3_REGION = get_env('S3_REGION')
|
2024-03-26 10:18:26 +08:00
|
|
|
self.S3_ADDRESS_STYLE = get_env('S3_ADDRESS_STYLE')
|
2024-06-05 00:13:04 +08:00
|
|
|
|
|
|
|
# Azure Blob Storage settings
|
2024-03-20 20:49:58 +08:00
|
|
|
self.AZURE_BLOB_ACCOUNT_NAME = get_env('AZURE_BLOB_ACCOUNT_NAME')
|
|
|
|
self.AZURE_BLOB_ACCOUNT_KEY = get_env('AZURE_BLOB_ACCOUNT_KEY')
|
|
|
|
self.AZURE_BLOB_CONTAINER_NAME = get_env('AZURE_BLOB_CONTAINER_NAME')
|
|
|
|
self.AZURE_BLOB_ACCOUNT_URL = get_env('AZURE_BLOB_ACCOUNT_URL')
|
2024-06-05 00:13:04 +08:00
|
|
|
|
|
|
|
# Aliyun Storage settings
|
2024-05-24 15:27:12 +08:00
|
|
|
self.ALIYUN_OSS_BUCKET_NAME = get_env('ALIYUN_OSS_BUCKET_NAME')
|
|
|
|
self.ALIYUN_OSS_ACCESS_KEY = get_env('ALIYUN_OSS_ACCESS_KEY')
|
|
|
|
self.ALIYUN_OSS_SECRET_KEY = get_env('ALIYUN_OSS_SECRET_KEY')
|
|
|
|
self.ALIYUN_OSS_ENDPOINT = get_env('ALIYUN_OSS_ENDPOINT')
|
|
|
|
self.ALIYUN_OSS_REGION = get_env('ALIYUN_OSS_REGION')
|
|
|
|
self.ALIYUN_OSS_AUTH_VERSION = get_env('ALIYUN_OSS_AUTH_VERSION')
|
2024-06-05 00:13:04 +08:00
|
|
|
|
|
|
|
# Google Cloud Storage settings
|
2024-04-27 18:26:52 +08:00
|
|
|
self.GOOGLE_STORAGE_BUCKET_NAME = get_env('GOOGLE_STORAGE_BUCKET_NAME')
|
|
|
|
self.GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64 = get_env('GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64')
|
2023-05-15 08:51:32 +08:00
|
|
|
|
2024-06-17 19:18:52 +08:00
|
|
|
# Tencent Cos Storage settings
|
|
|
|
self.TENCENT_COS_BUCKET_NAME = get_env('TENCENT_COS_BUCKET_NAME')
|
|
|
|
self.TENCENT_COS_REGION = get_env('TENCENT_COS_REGION')
|
|
|
|
self.TENCENT_COS_SECRET_ID = get_env('TENCENT_COS_SECRET_ID')
|
|
|
|
self.TENCENT_COS_SECRET_KEY = get_env('TENCENT_COS_SECRET_KEY')
|
|
|
|
self.TENCENT_COS_SCHEME = get_env('TENCENT_COS_SCHEME')
|
|
|
|
|
2023-11-13 22:05:46 +08:00
|
|
|
# ------------------------
|
|
|
|
# Vector Store Configurations.
|
2024-05-10 17:20:30 +08:00
|
|
|
# Currently, only support: qdrant, milvus, zilliz, weaviate, relyt, pgvector
|
2023-11-13 22:05:46 +08:00
|
|
|
# ------------------------
|
2024-06-05 00:13:04 +08:00
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
# qdrant settings
|
|
|
|
self.QDRANT_URL = get_env('QDRANT_URL')
|
|
|
|
self.QDRANT_API_KEY = get_env('QDRANT_API_KEY')
|
2024-01-03 22:23:04 +08:00
|
|
|
self.QDRANT_CLIENT_TIMEOUT = get_env('QDRANT_CLIENT_TIMEOUT')
|
2024-04-28 15:33:32 +08:00
|
|
|
self.QDRANT_GRPC_ENABLED = get_env('QDRANT_GRPC_ENABLED')
|
|
|
|
self.QDRANT_GRPC_PORT = get_env('QDRANT_GRPC_PORT')
|
2023-05-15 08:51:32 +08:00
|
|
|
|
2023-11-13 22:05:46 +08:00
|
|
|
# milvus / zilliz setting
|
2023-10-10 21:56:24 +08:00
|
|
|
self.MILVUS_HOST = get_env('MILVUS_HOST')
|
|
|
|
self.MILVUS_PORT = get_env('MILVUS_PORT')
|
|
|
|
self.MILVUS_USER = get_env('MILVUS_USER')
|
|
|
|
self.MILVUS_PASSWORD = get_env('MILVUS_PASSWORD')
|
|
|
|
self.MILVUS_SECURE = get_env('MILVUS_SECURE')
|
2024-04-09 15:39:36 +08:00
|
|
|
self.MILVUS_DATABASE = get_env('MILVUS_DATABASE')
|
2023-10-10 21:56:24 +08:00
|
|
|
|
2024-06-19 12:44:33 +08:00
|
|
|
# OpenSearch settings
|
|
|
|
self.OPENSEARCH_HOST = get_env('OPENSEARCH_HOST')
|
|
|
|
self.OPENSEARCH_PORT = get_env('OPENSEARCH_PORT')
|
|
|
|
self.OPENSEARCH_USER = get_env('OPENSEARCH_USER')
|
|
|
|
self.OPENSEARCH_PASSWORD = get_env('OPENSEARCH_PASSWORD')
|
|
|
|
self.OPENSEARCH_SECURE = get_bool_env('OPENSEARCH_SECURE')
|
|
|
|
|
2023-11-13 22:05:46 +08:00
|
|
|
# weaviate settings
|
|
|
|
self.WEAVIATE_ENDPOINT = get_env('WEAVIATE_ENDPOINT')
|
|
|
|
self.WEAVIATE_API_KEY = get_env('WEAVIATE_API_KEY')
|
|
|
|
self.WEAVIATE_GRPC_ENABLED = get_bool_env('WEAVIATE_GRPC_ENABLED')
|
|
|
|
self.WEAVIATE_BATCH_SIZE = int(get_env('WEAVIATE_BATCH_SIZE'))
|
2023-10-10 21:56:24 +08:00
|
|
|
|
2024-04-15 11:52:34 +08:00
|
|
|
# relyt settings
|
|
|
|
self.RELYT_HOST = get_env('RELYT_HOST')
|
|
|
|
self.RELYT_PORT = get_env('RELYT_PORT')
|
|
|
|
self.RELYT_USER = get_env('RELYT_USER')
|
|
|
|
self.RELYT_PASSWORD = get_env('RELYT_PASSWORD')
|
|
|
|
self.RELYT_DATABASE = get_env('RELYT_DATABASE')
|
|
|
|
|
2024-06-14 19:25:17 +08:00
|
|
|
# tencent settings
|
|
|
|
self.TENCENT_VECTOR_DB_URL = get_env('TENCENT_VECTOR_DB_URL')
|
|
|
|
self.TENCENT_VECTOR_DB_API_KEY = get_env('TENCENT_VECTOR_DB_API_KEY')
|
|
|
|
self.TENCENT_VECTOR_DB_TIMEOUT = get_env('TENCENT_VECTOR_DB_TIMEOUT')
|
|
|
|
self.TENCENT_VECTOR_DB_USERNAME = get_env('TENCENT_VECTOR_DB_USERNAME')
|
|
|
|
self.TENCENT_VECTOR_DB_DATABASE = get_env('TENCENT_VECTOR_DB_DATABASE')
|
|
|
|
self.TENCENT_VECTOR_DB_SHARD = get_env('TENCENT_VECTOR_DB_SHARD')
|
|
|
|
self.TENCENT_VECTOR_DB_REPLICAS = get_env('TENCENT_VECTOR_DB_REPLICAS')
|
|
|
|
|
2024-04-29 11:58:17 +08:00
|
|
|
# pgvecto rs settings
|
|
|
|
self.PGVECTO_RS_HOST = get_env('PGVECTO_RS_HOST')
|
|
|
|
self.PGVECTO_RS_PORT = get_env('PGVECTO_RS_PORT')
|
|
|
|
self.PGVECTO_RS_USER = get_env('PGVECTO_RS_USER')
|
|
|
|
self.PGVECTO_RS_PASSWORD = get_env('PGVECTO_RS_PASSWORD')
|
|
|
|
self.PGVECTO_RS_DATABASE = get_env('PGVECTO_RS_DATABASE')
|
|
|
|
|
2024-05-10 17:20:30 +08:00
|
|
|
# pgvector settings
|
|
|
|
self.PGVECTOR_HOST = get_env('PGVECTOR_HOST')
|
|
|
|
self.PGVECTOR_PORT = get_env('PGVECTOR_PORT')
|
|
|
|
self.PGVECTOR_USER = get_env('PGVECTOR_USER')
|
|
|
|
self.PGVECTOR_PASSWORD = get_env('PGVECTOR_PASSWORD')
|
|
|
|
self.PGVECTOR_DATABASE = get_env('PGVECTOR_DATABASE')
|
|
|
|
|
2024-06-05 18:19:53 +08:00
|
|
|
# tidb-vector settings
|
|
|
|
self.TIDB_VECTOR_HOST = get_env('TIDB_VECTOR_HOST')
|
|
|
|
self.TIDB_VECTOR_PORT = get_env('TIDB_VECTOR_PORT')
|
|
|
|
self.TIDB_VECTOR_USER = get_env('TIDB_VECTOR_USER')
|
|
|
|
self.TIDB_VECTOR_PASSWORD = get_env('TIDB_VECTOR_PASSWORD')
|
|
|
|
self.TIDB_VECTOR_DATABASE = get_env('TIDB_VECTOR_DATABASE')
|
|
|
|
|
2024-06-13 18:02:18 +08:00
|
|
|
# chroma settings
|
|
|
|
self.CHROMA_HOST = get_env('CHROMA_HOST')
|
|
|
|
self.CHROMA_PORT = get_env('CHROMA_PORT')
|
|
|
|
self.CHROMA_TENANT = get_env('CHROMA_TENANT')
|
|
|
|
self.CHROMA_DATABASE = get_env('CHROMA_DATABASE')
|
|
|
|
self.CHROMA_AUTH_PROVIDER = get_env('CHROMA_AUTH_PROVIDER')
|
|
|
|
self.CHROMA_AUTH_CREDENTIALS = get_env('CHROMA_AUTH_CREDENTIALS')
|
|
|
|
|
2023-11-13 22:05:46 +08:00
|
|
|
# ------------------------
|
|
|
|
# Platform Configurations.
|
|
|
|
# ------------------------
|
2023-08-12 00:57:00 +08:00
|
|
|
self.HOSTED_OPENAI_API_KEY = get_env('HOSTED_OPENAI_API_KEY')
|
|
|
|
self.HOSTED_OPENAI_API_BASE = get_env('HOSTED_OPENAI_API_BASE')
|
|
|
|
self.HOSTED_OPENAI_API_ORGANIZATION = get_env('HOSTED_OPENAI_API_ORGANIZATION')
|
2024-01-17 15:02:27 +08:00
|
|
|
self.HOSTED_OPENAI_TRIAL_ENABLED = get_bool_env('HOSTED_OPENAI_TRIAL_ENABLED')
|
2024-02-23 16:12:43 +08:00
|
|
|
self.HOSTED_OPENAI_TRIAL_MODELS = get_env('HOSTED_OPENAI_TRIAL_MODELS')
|
2023-08-17 16:56:20 +08:00
|
|
|
self.HOSTED_OPENAI_QUOTA_LIMIT = int(get_env('HOSTED_OPENAI_QUOTA_LIMIT'))
|
2023-08-12 00:57:00 +08:00
|
|
|
self.HOSTED_OPENAI_PAID_ENABLED = get_bool_env('HOSTED_OPENAI_PAID_ENABLED')
|
2024-02-23 16:12:43 +08:00
|
|
|
self.HOSTED_OPENAI_PAID_MODELS = get_env('HOSTED_OPENAI_PAID_MODELS')
|
2023-08-12 00:57:00 +08:00
|
|
|
|
|
|
|
self.HOSTED_AZURE_OPENAI_ENABLED = get_bool_env('HOSTED_AZURE_OPENAI_ENABLED')
|
|
|
|
self.HOSTED_AZURE_OPENAI_API_KEY = get_env('HOSTED_AZURE_OPENAI_API_KEY')
|
|
|
|
self.HOSTED_AZURE_OPENAI_API_BASE = get_env('HOSTED_AZURE_OPENAI_API_BASE')
|
2023-08-17 16:56:20 +08:00
|
|
|
self.HOSTED_AZURE_OPENAI_QUOTA_LIMIT = int(get_env('HOSTED_AZURE_OPENAI_QUOTA_LIMIT'))
|
2023-08-12 00:57:00 +08:00
|
|
|
|
|
|
|
self.HOSTED_ANTHROPIC_API_BASE = get_env('HOSTED_ANTHROPIC_API_BASE')
|
|
|
|
self.HOSTED_ANTHROPIC_API_KEY = get_env('HOSTED_ANTHROPIC_API_KEY')
|
2024-01-17 15:02:27 +08:00
|
|
|
self.HOSTED_ANTHROPIC_TRIAL_ENABLED = get_bool_env('HOSTED_ANTHROPIC_TRIAL_ENABLED')
|
2023-08-17 16:56:20 +08:00
|
|
|
self.HOSTED_ANTHROPIC_QUOTA_LIMIT = int(get_env('HOSTED_ANTHROPIC_QUOTA_LIMIT'))
|
2023-08-12 00:57:00 +08:00
|
|
|
self.HOSTED_ANTHROPIC_PAID_ENABLED = get_bool_env('HOSTED_ANTHROPIC_PAID_ENABLED')
|
2024-01-17 15:02:27 +08:00
|
|
|
|
|
|
|
self.HOSTED_MINIMAX_ENABLED = get_bool_env('HOSTED_MINIMAX_ENABLED')
|
|
|
|
self.HOSTED_SPARK_ENABLED = get_bool_env('HOSTED_SPARK_ENABLED')
|
|
|
|
self.HOSTED_ZHIPUAI_ENABLED = get_bool_env('HOSTED_ZHIPUAI_ENABLED')
|
2023-08-12 00:57:00 +08:00
|
|
|
|
2023-09-12 10:26:12 +08:00
|
|
|
self.HOSTED_MODERATION_ENABLED = get_bool_env('HOSTED_MODERATION_ENABLED')
|
|
|
|
self.HOSTED_MODERATION_PROVIDERS = get_env('HOSTED_MODERATION_PROVIDERS')
|
|
|
|
|
2024-04-08 18:51:46 +08:00
|
|
|
# fetch app templates mode, remote, builtin, db(only for dify SaaS), default: remote
|
|
|
|
self.HOSTED_FETCH_APP_TEMPLATES_MODE = get_env('HOSTED_FETCH_APP_TEMPLATES_MODE')
|
|
|
|
self.HOSTED_FETCH_APP_TEMPLATES_REMOTE_DOMAIN = get_env('HOSTED_FETCH_APP_TEMPLATES_REMOTE_DOMAIN')
|