mirror of https://github.com/langgenius/dify.git
fix const
This commit is contained in:
parent
317884ead4
commit
782fc332e1
|
|
@ -6,9 +6,16 @@ class HostedTrialProvider(StrEnum):
|
|||
Enum representing hosted model provider names for trial access.
|
||||
"""
|
||||
|
||||
OPENAI = "openai"
|
||||
DEEPSEEK = "deepseek"
|
||||
ANTHROPIC = "anthropic"
|
||||
GEMINI = "gemini"
|
||||
XAI = "xai"
|
||||
TONGYI = "tongyi"
|
||||
OPENAI = "langgenius/openai"
|
||||
ANTHROPIC = "langgenius/anthropic"
|
||||
GEMINI = "langgenius/gemini"
|
||||
X = "langgenius/x"
|
||||
DEEPSEEK = "langgenius/deepseek"
|
||||
TONGYI = "langgenius/tongyi"
|
||||
|
||||
@property
|
||||
def config_key(self) -> str:
|
||||
"""Return the config key used in dify_config (e.g., HOSTED_{config_key}_PAID_ENABLED)."""
|
||||
if self == HostedTrialProvider.X:
|
||||
return "XAI"
|
||||
return self.name
|
||||
|
|
|
|||
|
|
@ -232,11 +232,11 @@ class FeatureService:
|
|||
@classmethod
|
||||
def _fulfill_trial_models_from_env(cls) -> list[str]:
|
||||
return [
|
||||
provider
|
||||
provider.value
|
||||
for provider in HostedTrialProvider
|
||||
if (
|
||||
getattr(dify_config, f"HOSTED_{provider.upper()}_PAID_ENABLED", False)
|
||||
and getattr(dify_config, f"HOSTED_{provider.upper()}_TRIAL_ENABLED", False)
|
||||
getattr(dify_config, f"HOSTED_{provider.config_key}_PAID_ENABLED", False)
|
||||
and getattr(dify_config, f"HOSTED_{provider.config_key}_TRIAL_ENABLED", False)
|
||||
)
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue