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.

fix: dataset query error. (#1244)

Garfield Dai54ff03c35d39
diff --git a/api/models/model.py b/api/models/model.py
index 5fb2abe71c1..dd7f09bf78a 100644
--- a/api/models/model.py
+++ b/api/models/model.py
@@ -172,7 +172,7 @@ class AppModelConfig(db.Model):
if model_config.get('sensitive_word_avoidance') else None
self.model = json.dumps(model_config['model'])
self.user_input_form = json.dumps(model_config['user_input_form'])
- self.dataset_query_variable = model_config['dataset_query_variable']
+ self.dataset_query_variable = model_config.get('dataset_query_variable')
self.pre_prompt = model_config['pre_prompt']
self.agent_mode = json.dumps(model_config['agent_mode'])
self.retriever_resource = json.dumps(model_config['retriever_resource']) \
diff --git a/api/services/app_model_config_service.py b/api/services/app_model_config_service.py
index f3334ca9b99..916a1078e5b 100644
--- a/api/services/app_model_config_service.py
+++ b/api/services/app_model_config_service.py
@@ -354,7 +354,7 @@ class AppModelConfigService:
"completion_params": config["model"]["completion_params"]
},
"user_input_form": config["user_input_form"],
- "dataset_query_variable": config["dataset_query_variable"],
+ "dataset_query_variable": config.get('dataset_query_variable'),
"pre_prompt": config["pre_prompt"],
"agent_mode": config["agent_mode"]
}