mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
7753ba2d37
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Yeuoly <admin@srmxy.cn> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: jyong <jyong@dify.ai> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: jyong <718720800@qq.com>
19 lines
851 B
Python
19 lines
851 B
Python
from core.app.apps.agent_chat.app_config_manager import AgentChatAppConfigManager
|
|
from core.app.apps.chat.app_config_manager import ChatAppConfigManager
|
|
from core.app.apps.completion.app_config_manager import CompletionAppConfigManager
|
|
from models.model import AppMode
|
|
|
|
|
|
class AppModelConfigService:
|
|
|
|
@classmethod
|
|
def validate_configuration(cls, tenant_id: str, config: dict, app_mode: AppMode) -> dict:
|
|
if app_mode == AppMode.CHAT:
|
|
return ChatAppConfigManager.config_validate(tenant_id, config)
|
|
elif app_mode == AppMode.AGENT_CHAT:
|
|
return AgentChatAppConfigManager.config_validate(tenant_id, config)
|
|
elif app_mode == AppMode.COMPLETION:
|
|
return CompletionAppConfigManager.config_validate(tenant_id, config)
|
|
else:
|
|
raise ValueError(f"Invalid app mode: {app_mode}")
|