feat: Make the logic of APP filtering and creation the same (#16079)

Co-authored-by: 刘江波 <jiangbo721@163.com>
This commit is contained in:
jiangbo721
2025-03-23 09:40:15 +08:00
committed by GitHub
parent f6ac98a37d
commit f31e3313b0
3 changed files with 18 additions and 3 deletions

View File

@@ -36,9 +36,13 @@ class AppService:
filters = [App.tenant_id == tenant_id, App.is_universal == False]
if args["mode"] == "workflow":
filters.append(App.mode.in_([AppMode.WORKFLOW.value, AppMode.COMPLETION.value]))
filters.append(App.mode == AppMode.WORKFLOW.value)
elif args["mode"] == "completion":
filters.append(App.mode == AppMode.COMPLETION.value)
elif args["mode"] == "chat":
filters.append(App.mode.in_([AppMode.CHAT.value, AppMode.ADVANCED_CHAT.value]))
filters.append(App.mode == AppMode.CHAT.value)
elif args["mode"] == "advanced-chat":
filters.append(App.mode == AppMode.ADVANCED_CHAT.value)
elif args["mode"] == "agent-chat":
filters.append(App.mode == AppMode.AGENT_CHAT.value)
elif args["mode"] == "channel":