Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

clean duplicate validate for dataset_configs (#20775)

湛露先生6d033d406444
diff --git a/api/core/app/app_config/easy_ui_based_app/dataset/manager.py b/api/core/app/app_config/easy_ui_based_app/dataset/manager.py
index 20189053f48..a5492d70bdf 100644
--- a/api/core/app/app_config/easy_ui_based_app/dataset/manager.py
+++ b/api/core/app/app_config/easy_ui_based_app/dataset/manager.py
@@ -138,14 +138,11 @@ class DatasetConfigManager:
if not config.get("dataset_configs"):
config["dataset_configs"] = {"retrieval_model": "single"}
- if not config["dataset_configs"].get("datasets"):
- config["dataset_configs"]["datasets"] = {"strategy": "router", "datasets": []}
-
if not isinstance(config["dataset_configs"], dict):
raise ValueError("dataset_configs must be of object type")
- if not isinstance(config["dataset_configs"], dict):
- raise ValueError("dataset_configs must be of object type")
+ if not config["dataset_configs"].get("datasets"):
+ config["dataset_configs"]["datasets"] = {"strategy": "router", "datasets": []}
need_manual_query_datasets = config.get("dataset_configs") and config["dataset_configs"].get(
"datasets", {}