mirror of
https://github.com/langgenius/dify.git
synced 2026-06-22 19:21:13 +08:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: fatelei <fatelei@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: 盐粒 Yanli <yanli@dify.ai> Co-authored-by: Charles Yao <chongbinyao33@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: yunlu.wen <yunlu.wen@dify.ai> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com> Co-authored-by: Jingyi <jingyi.qi@dify.ai> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com> Co-authored-by: gigglewang <gigglewang@dify.ai> Co-authored-by: chariri <w@chariri.moe> Co-authored-by: Evan <2869018789@qq.com> Co-authored-by: zyssyz123 <916125788@qq.com>
85 lines
2.6 KiB
Python
85 lines
2.6 KiB
Python
from pydantic import Field
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class EnterpriseFeatureConfig(BaseSettings):
|
|
"""
|
|
Configuration for enterprise-level features.
|
|
**Before using, please contact business@dify.ai by email to inquire about licensing matters.**
|
|
"""
|
|
|
|
ENTERPRISE_ENABLED: bool = Field(
|
|
description="Enable or disable enterprise-level features."
|
|
"Before using, please contact business@dify.ai by email to inquire about licensing matters.",
|
|
default=False,
|
|
)
|
|
|
|
CAN_REPLACE_LOGO: bool = Field(
|
|
description="Allow customization of the enterprise logo.",
|
|
default=True,
|
|
)
|
|
|
|
ENTERPRISE_REQUEST_TIMEOUT: int = Field(
|
|
ge=1, description="Maximum timeout in seconds for enterprise requests", default=5
|
|
)
|
|
|
|
ENTERPRISE_DISABLE_RUNTIME_CREDENTIAL_CHECK: bool = Field(
|
|
default=False,
|
|
description="If disabled, credential policy check is only performed when saving workflows."
|
|
"This helps gain runtime performance by trading off consistency.",
|
|
)
|
|
|
|
RBAC_ENABLED: bool = Field(
|
|
description="Enable enterprise RBAC APIs. When disabled, compatibility responses fall back to legacy roles.",
|
|
default=False,
|
|
)
|
|
|
|
|
|
class EnterpriseTelemetryConfig(BaseSettings):
|
|
"""
|
|
Configuration for enterprise telemetry.
|
|
"""
|
|
|
|
ENTERPRISE_TELEMETRY_ENABLED: bool = Field(
|
|
description="Enable enterprise telemetry collection (also requires ENTERPRISE_ENABLED=true).",
|
|
default=False,
|
|
)
|
|
|
|
ENTERPRISE_OTLP_ENDPOINT: str = Field(
|
|
description="Enterprise OTEL collector endpoint.",
|
|
default="",
|
|
)
|
|
|
|
ENTERPRISE_OTLP_HEADERS: str = Field(
|
|
description="Auth headers for OTLP export (key=value,key2=value2).",
|
|
default="",
|
|
)
|
|
|
|
ENTERPRISE_OTLP_PROTOCOL: str = Field(
|
|
description="OTLP protocol: 'http' or 'grpc' (default: http).",
|
|
default="http",
|
|
)
|
|
|
|
ENTERPRISE_OTLP_API_KEY: str = Field(
|
|
description="Bearer token for enterprise OTLP export authentication.",
|
|
default="",
|
|
)
|
|
|
|
ENTERPRISE_INCLUDE_CONTENT: bool = Field(
|
|
description="Include input/output content in traces (privacy toggle).",
|
|
# Setting the default value to False to avoid accidentally log PII data in traces.
|
|
default=False,
|
|
)
|
|
|
|
ENTERPRISE_SERVICE_NAME: str = Field(
|
|
description="Service name for OTEL resource.",
|
|
default="dify",
|
|
)
|
|
|
|
ENTERPRISE_OTEL_SAMPLING_RATE: float = Field(
|
|
description="Sampling rate for enterprise traces (0.0 to 1.0, default 1.0 = 100%).",
|
|
default=1.0,
|
|
ge=0.0,
|
|
le=1.0,
|
|
)
|